package com.greenantmall.adapter;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Paint;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.text.TextUtils;
import android.util.Log;
import android.view.GestureDetector.OnGestureListener;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.greenantmall.AntHomeApplication;
import com.greenantmall.R;
import com.greenantmall.activity.DetailActivity;
import com.greenantmall.activity.GoodsListActivity;
import com.greenantmall.activity.GoodsListTradeStyleActivity;
import com.greenantmall.bean.Goods;
import com.greenantmall.bean.GoodsStyles;
import com.greenantmall.bean.PortalItemData;
import com.greenantmall.bean.ServerSection;
import com.greenantmall.bean.UIBanners;
import com.greenantmall.bean.UIGoods;
import com.greenantmall.bean.UIGoodsCategory;
import com.greenantmall.bean.UIGoodsRecommend;
import com.greenantmall.home.ActivityIndependentStoreHome;
import com.greenantmall.utils.UtilTools;
import com.greenantmall.view.MyViewPager;
import com.greenantmall.view.PortalNoticeDialog;
import com.nostra13.universalimageloader.core.ImageLoader;

public class PortalListViewAdapter extends BaseAdapter {
	private Context mContext;
	private List<PortalItemData> mDataList;
	private LayoutInflater mLayoutInflater;
	private DecimalFormat mDecimalFormat;

	public PortalListViewAdapter(Context context, List<PortalItemData> dataList) {
		this.mContext = context;
		this.mDataList = dataList;
		mLayoutInflater = LayoutInflater.from(mContext);
		mDecimalFormat = new DecimalFormat("#########.##");
	}

	@Override
	public int getCount() {
		if (mDataList != null) {
			return mDataList.size();
		}
		return 0;
	}

	@Override
	public Object getItem(int arg0) {
		if (mDataList != null) {
			int size = mDataList.size();
			if (arg0 >= 0 && arg0 < size) {
				return mDataList.get(arg0);
			}
		}
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	@Override
	public int getItemViewType(int position) {
		return mDataList.get(position).mType;
	}

	@Override
	public int getViewTypeCount() {
		return PortalItemData.TYPES_COUNT;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		int type = this.getItemViewType(position);
		View child = null;
		switch (type) {
		case PortalItemData.TYPE_BANNERS:
			child = this.getChildBanners(position, convertView, parent);
			break;
		case PortalItemData.TYPE_NOTICE:
			child = this.getChildNotice(position, convertView, parent);
			break;
		case PortalItemData.TYPE_TRADE:
			child = this.getChildTrade(position, convertView, parent);
			break;
		case PortalItemData.TYPE_ITEM1_WITH_TITLE:
			child = this.getChildItem1WithTitle(position, convertView, parent);
			break;
		case PortalItemData.TYPE_ITEM2_WITH_TITLE:
			child = this.getChildItem2WithTitle(position, convertView, parent);
			break;
		case PortalItemData.TYPE_ITEM_IMAGE:
			child = this.getChildItemImage(position, convertView, parent);
			break;
		case PortalItemData.TYPE_ITEM3_WITH_TITLE:
			child = this.getChildItem3WithTitle(position, convertView, parent);
			break;
		case PortalItemData.TYPE_ITEM3:
			child = this.getChildItem3(position, convertView, parent);
			break;
		}

		if (child == null) {
			child = new View(mContext);
		}
		return child;
	}
	
	public View getChildBanners(int position, View convertView, ViewGroup parent) {
		ViewHolderBanners holderBanners = null;
		View child = convertView;
		if (child == null) {
			child = mLayoutInflater.inflate(R.layout.portal_item_banners, null);
			holderBanners = new ViewHolderBanners(child);
			child.setTag(holderBanners);
		} else {
			holderBanners = (ViewHolderBanners) child.getTag();
		}

		List<UIBanners> antBanners = (List<UIBanners>) (mDataList.get(position).mDataObj);
		Log.d("CEXX", "CEXX ---> antBanners ---> size : " + antBanners.size());
		holderBanners.setData(antBanners);

		return child;
	}
	
	public View getChildNotice(int position, View convertView, ViewGroup parent) {
		ViewHolderNotice holderNotice = null;
		View child = convertView;
		if (child == null) {
			child = mLayoutInflater.inflate(R.layout.portal_item_notice, null);
			holderNotice = new ViewHolderNotice(child);
			child.setTag(holderNotice);
		} else {
			holderNotice = (ViewHolderNotice) child.getTag();
		}

		holderNotice.setPosition(position);
		String notice = (String)(mDataList.get(position).mDataObj);
		Log.d("CEXX", "CEXX ---> notice ---> notice : " + notice);
		holderNotice.getTvNotice().setText(notice);
		holderNotice.getTvNotice().setSelected(true);

		return child;
	}

	public View getChildTrade(int position, View convertView, ViewGroup parent) {
		ViewHolderTrade holderTrade = null;
		View child = convertView;
		if (child == null) {
			child = mLayoutInflater.inflate(R.layout.portal_item_trade, null);
			holderTrade = new ViewHolderTrade(child);
			child.setTag(holderTrade);
		} else {
			holderTrade = (ViewHolderTrade) child.getTag();
		}

		List<UIGoodsCategory> list = 
				(List<UIGoodsCategory>) (mDataList.get(position).mDataObj);
		holderTrade.setUIGoodsCategoryList(list);
		
		int size = list.size();
		Log.d("CEXX", "CEXX ---> AntTradeStyle ---> size : " + size);
		for (int i = 0; i < size; i++) {
			ImageView iv = null;
			TextView tv = null;
			switch (i) {
			case 0:
				holderTrade.getLinearLayoutItem_0().setVisibility(View.VISIBLE);
				iv = holderTrade.getIvCircle_0();
				tv = holderTrade.getTvDes_0();
				break;
			case 1:
				holderTrade.getLinearLayoutItem_1().setVisibility(View.VISIBLE);
				iv = holderTrade.getIvCircle_1();
				tv = holderTrade.getTvDes_1();
				break;
			case 2:
				holderTrade.getLinearLayoutItem_2().setVisibility(View.VISIBLE);
				iv = holderTrade.getIvCircle_2();
				tv = holderTrade.getTvDes_2();
				break;
			case 3:
				holderTrade.getLinearLayoutItem_3().setVisibility(View.VISIBLE);
				iv = holderTrade.getIvCircle_3();
				tv = holderTrade.getTvDes_3();
				break;
			}

			if (iv != null && tv != null) {
				UIGoodsCategory trade = list.get(i);
				String picurl = trade.getPicUrl();
				String des = trade.getName();
				Log.d("CEXX", "CEXX ---> AntTradeStyle ---> picurl : " + picurl);
				Log.d("CEXX", "CEXX ---> AntTradeStyle ---> des : " + des);
				if (!TextUtils.isEmpty(picurl)) {
					ImageLoader.getInstance().displayImage(picurl, iv,AntHomeApplication.imageDisplayOptions);
				}
				if (!TextUtils.isEmpty(des)) {
					tv.setText(des);
				}
			}
		}

		for (int i = size; i < 4; i++) {
			switch (i) {
			case 0:
				holderTrade.getLinearLayoutItem_0().setVisibility(
						View.INVISIBLE);
				break;
			case 1:
				holderTrade.getLinearLayoutItem_1().setVisibility(
						View.INVISIBLE);
				break;
			case 2:
				holderTrade.getLinearLayoutItem_2().setVisibility(
						View.INVISIBLE);
				break;
			case 3:
				holderTrade.getLinearLayoutItem_3().setVisibility(
						View.INVISIBLE);
				break;
			}
		}

		return child;
	}

	public View getChildItem1WithTitle(int position, View convertView,
			ViewGroup parent) {
		ViewHolderItem1WithTitle holderItem1WithTitle = null;
		View child = convertView;
		if (child == null) {
			child = mLayoutInflater.inflate(R.layout.portal_item_1_with_title,
					null);
			holderItem1WithTitle = new ViewHolderItem1WithTitle(child);
			child.setTag(holderItem1WithTitle);
		} else {
			holderItem1WithTitle = (ViewHolderItem1WithTitle) child.getTag();
		}
		
		PortalItemData itemData = mDataList.get(position);
		List<UIGoods> list = (List<UIGoods>)(itemData.mDataObj);
		holderItem1WithTitle.setUIGoodsList(list);
		
		int size = list.size();
		Log.d("CEXX", "CEXX ---> getChildItem1WithTitle --> UIGoods ---> size : " + size);
		
		View iconView = holderItem1WithTitle.getTitleIcon();
		TextView titleDesTv = holderItem1WithTitle.getTvTitleDes();
		String titleUrl = itemData.mTitleIconUrl;
		String titleDes = itemData.mTitleDes;
		if(!TextUtils.isEmpty(titleUrl)) {
			iconView.setVisibility(View.VISIBLE);
			titleDesTv.setVisibility(View.GONE);
			ImageLoader.getInstance().displayImage(titleUrl, holderItem1WithTitle.getTitleIcon(),AntHomeApplication.imageDisplayOptions);
		}
		else {
			iconView.setVisibility(View.GONE);
			titleDesTv.setVisibility(View.VISIBLE);
			titleDesTv.setText(titleDes==null ? "" : titleDes);
		}
		
		UIGoods goods0 = null;
		UIGoods goods1 = null;
		UIGoods goods2 = null;
		if(size > 0)
		{
			goods0 = list.get(0);
		}
		
		if(size > 1)
		{
			goods1 = list.get(1);
		}
		
		if(size > 2)
		{
			goods2 = list.get(2);
		}
		
		if(goods0 != null) {
			int showTag = goods0.getShowTag();
			switch(showTag) {
			case 1:
				holderItem1WithTitle.getShowTag0().setVisibility(View.VISIBLE);
				holderItem1WithTitle.getShowTag0().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem1WithTitle.getShowTag0().setVisibility(View.VISIBLE);
				holderItem1WithTitle.getShowTag0().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem1WithTitle.getShowTag0().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods0.getStock() <= 0) {
				holderItem1WithTitle.getShowTagSoldOut0().setVisibility(View.VISIBLE);
			}
			else {
				holderItem1WithTitle.getShowTagSoldOut0().setVisibility(View.GONE);
			}
			
			if (!TextUtils.isEmpty(goods0.getPicUrl())) {
				ImageLoader.getInstance().displayImage(goods0.getPicUrl(), holderItem1WithTitle.getIvPic0(),AntHomeApplication.imageDisplayOptions);
			}
			
			holderItem1WithTitle.getTvPrice0().setText(mDecimalFormat.format(goods0.getPriceAfterDiscount()));
			double pricePrevious = goods0.getPriceBeforeDiscount();
			if(pricePrevious > 0) {
				holderItem1WithTitle.getTvPricePrevious0().getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG );
				holderItem1WithTitle.getTvPricePrevious0().setText(mDecimalFormat.format(pricePrevious));
				holderItem1WithTitle.getTvPricePrevious0().setVisibility(View.VISIBLE);
			}
			else {
				holderItem1WithTitle.getTvPricePrevious0().setVisibility(View.INVISIBLE);
			}

			holderItem1WithTitle.getTvPrice0().setVisibility(View.VISIBLE);
			holderItem1WithTitle.getIvPic0().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem1WithTitle.getTvPrice0().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getTvPricePrevious0().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getIvPic0().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getShowTag0().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getShowTagSoldOut0().setVisibility(View.INVISIBLE);
		}
		
		if(goods1 != null) {
			int showTag = goods1.getShowTag();
			switch(showTag) {
			case 1:
				holderItem1WithTitle.getShowTag1().setVisibility(View.VISIBLE);
				holderItem1WithTitle.getShowTag1().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem1WithTitle.getShowTag1().setVisibility(View.VISIBLE);
				holderItem1WithTitle.getShowTag1().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem1WithTitle.getShowTag1().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods1.getStock() <= 0) {
				holderItem1WithTitle.getShowTagSoldOut1().setVisibility(View.VISIBLE);
			}
			else {
				holderItem1WithTitle.getShowTagSoldOut1().setVisibility(View.GONE);
			}
			
			if (!TextUtils.isEmpty(goods1.getPicUrl())) {
				ImageLoader.getInstance().displayImage(goods1.getPicUrl(), holderItem1WithTitle.getIvPic1(),AntHomeApplication.imageDisplayOptions);
			}
			
			holderItem1WithTitle.getTvPrice1().setText(mDecimalFormat.format(goods1.getPriceAfterDiscount()));
			double pricePrevious = goods1.getPriceBeforeDiscount();
			if(pricePrevious > 0) {
				holderItem1WithTitle.getTvPricePrevious1().getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG );
				holderItem1WithTitle.getTvPricePrevious1().setText(mDecimalFormat.format(pricePrevious));
				holderItem1WithTitle.getTvPricePrevious1().setVisibility(View.VISIBLE);
			}
			else {
				holderItem1WithTitle.getTvPricePrevious1().setVisibility(View.INVISIBLE);
			}

			holderItem1WithTitle.getTvPrice1().setVisibility(View.VISIBLE);
			holderItem1WithTitle.getIvPic1().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem1WithTitle.getTvPrice1().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getTvPricePrevious1().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getIvPic1().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getShowTag1().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getShowTagSoldOut1().setVisibility(View.INVISIBLE);
		}
		
		if(goods2 != null) {
			int showTag = goods2.getShowTag();
			switch(showTag) {
			case 1:
				holderItem1WithTitle.getShowTag2().setVisibility(View.VISIBLE);
				holderItem1WithTitle.getShowTag2().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem1WithTitle.getShowTag2().setVisibility(View.VISIBLE);
				holderItem1WithTitle.getShowTag2().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem1WithTitle.getShowTag2().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods2.getStock() <= 0) {
				holderItem1WithTitle.getShowTagSoldOut2().setVisibility(View.VISIBLE);
			}
			else {
				holderItem1WithTitle.getShowTagSoldOut2().setVisibility(View.GONE);
			}
			
			if (!TextUtils.isEmpty(goods2.getPicUrl())) {
				ImageLoader.getInstance().displayImage(goods2.getPicUrl(), holderItem1WithTitle.getIvPic2(),AntHomeApplication.imageDisplayOptions);
			}
			
			holderItem1WithTitle.getTvPrice2().setText(mDecimalFormat.format(goods2.getPriceAfterDiscount()));
			double pricePrevious = goods2.getPriceBeforeDiscount();
			if(pricePrevious > 0) {
				holderItem1WithTitle.getTvPricePrevious2().getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG );
				holderItem1WithTitle.getTvPricePrevious2().setText(mDecimalFormat.format(pricePrevious));
				holderItem1WithTitle.getTvPricePrevious2().setVisibility(View.VISIBLE);
			}
			else {
				holderItem1WithTitle.getTvPricePrevious2().setVisibility(View.INVISIBLE);
			}

			holderItem1WithTitle.getTvPrice2().setVisibility(View.VISIBLE);
			holderItem1WithTitle.getIvPic2().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem1WithTitle.getTvPrice2().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getTvPricePrevious2().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getIvPic2().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getShowTag2().setVisibility(View.INVISIBLE);
			holderItem1WithTitle.getShowTagSoldOut2().setVisibility(View.INVISIBLE);
		}

		return child;
	}

	public View getChildItem2WithTitle(int position, View convertView,
			ViewGroup parent) {
		ViewHolderItem2WithTitle holderItem2WithTitle = null;
		View child = convertView;
		if (child == null) {
			child = mLayoutInflater.inflate(R.layout.portal_item_2_with_title,
					null);
			holderItem2WithTitle = new ViewHolderItem2WithTitle(child);
			child.setTag(holderItem2WithTitle);
		} else {
			holderItem2WithTitle = (ViewHolderItem2WithTitle) child.getTag();
		}
		
		PortalItemData itemData = mDataList.get(position);
		List<UIGoods> list = (List<UIGoods>)(itemData.mDataObj);
		holderItem2WithTitle.setUIGoodsList(list);
		
		int size = list.size();
		Log.d("CEXX", "CEXX ---> getChildItem2WithTitle --> UIGoods ---> size : " + size);
		
		View iconView = holderItem2WithTitle.getTitleIcon();
		TextView titleDesTv = holderItem2WithTitle.getTvTitleDes();
		String titleUrl = itemData.mTitleIconUrl;
		String titleDes = itemData.mTitleDes;
		if(!TextUtils.isEmpty(titleUrl)) {
			iconView.setVisibility(View.VISIBLE);
			titleDesTv.setVisibility(View.GONE);
			ImageLoader.getInstance().displayImage(titleUrl, holderItem2WithTitle.getTitleIcon(),AntHomeApplication.imageDisplayOptions);
		}
		else {
			iconView.setVisibility(View.GONE);
			titleDesTv.setVisibility(View.VISIBLE);
			titleDesTv.setText(titleDes==null ? "" : titleDes);
		}
		
		UIGoods goods0 = null;
		UIGoods goods1 = null;
		UIGoods goods2 = null;
		if(size > 0)
		{
			goods0 = list.get(0);
		}
		
		if(size > 1)
		{
			goods1 = list.get(1);
		}
		
		if(size > 2)
		{
			goods2 = list.get(2);
		}
		
		if(goods0 != null) {
			holderItem2WithTitle.getTvPrice0().setText(mDecimalFormat.format(goods0.getPriceAfterDiscount()));
			
			double discount = goods0.getDiscount();
			if(discount <= 0) {
				holderItem2WithTitle.getTvPriceDiscount0().setVisibility(View.INVISIBLE);
			}
			else {
				holderItem2WithTitle.getTvPriceDiscount0().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getTvPriceDiscount0().setText(
						goods0.getDiscount() + mContext.getResources().getString(R.string.discount));
			}
			
			if (!TextUtils.isEmpty(goods0.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods0.getPicUrl(), holderItem2WithTitle.getIvPic0(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods0.getShowTag();
			switch(showTag) {
			case 1:
				holderItem2WithTitle.getShowTag0().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getShowTag0().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem2WithTitle.getShowTag0().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getShowTag0().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem2WithTitle.getShowTag0().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods0.getStock() <= 0) {
				holderItem2WithTitle.getShowTagSoldOut0().setVisibility(View.VISIBLE);
			}
			else {
				holderItem2WithTitle.getShowTagSoldOut0().setVisibility(View.GONE);
			}

			holderItem2WithTitle.getTvPrice0().setVisibility(View.VISIBLE);
			holderItem2WithTitle.getIvPic0().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem2WithTitle.getTvPrice0().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getTvPriceDiscount0().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getIvPic0().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getShowTag0().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getShowTagSoldOut0().setVisibility(View.INVISIBLE);
		}
		
		if(goods1 != null) {
			holderItem2WithTitle.getTvPrice1().setText(mDecimalFormat.format(goods1.getPriceAfterDiscount()));
			
			double discount = goods1.getDiscount();
			if(discount <= 0) {
				holderItem2WithTitle.getTvPriceDiscount1().setVisibility(View.INVISIBLE);
			}
			else {
				holderItem2WithTitle.getTvPriceDiscount1().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getTvPriceDiscount1().setText(
						goods1.getDiscount() + mContext.getResources().getString(R.string.discount));
			}
			
			if (!TextUtils.isEmpty(goods1.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods1.getPicUrl(), holderItem2WithTitle.getIvPic1(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods1.getShowTag();
			switch(showTag) {
			case 1:
				holderItem2WithTitle.getShowTag1().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getShowTag1().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem2WithTitle.getShowTag1().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getShowTag1().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem2WithTitle.getShowTag1().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods1.getStock() <= 0) {
				holderItem2WithTitle.getShowTagSoldOut1().setVisibility(View.VISIBLE);
			}
			else {
				holderItem2WithTitle.getShowTagSoldOut1().setVisibility(View.GONE);
			}

			holderItem2WithTitle.getTvPrice1().setVisibility(View.VISIBLE);
			holderItem2WithTitle.getIvPic1().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem2WithTitle.getTvPrice1().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getTvPriceDiscount1().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getIvPic1().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getShowTag1().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getShowTagSoldOut1().setVisibility(View.INVISIBLE);
		}
		
		if(goods2 != null) {
			holderItem2WithTitle.getTvPrice2().setText(mDecimalFormat.format(goods2.getPriceAfterDiscount()));
			
			double discount = goods2.getDiscount();
			if(discount <= 0) {
				holderItem2WithTitle.getTvPriceDiscount2().setVisibility(View.INVISIBLE);
			}
			else {
				holderItem2WithTitle.getTvPriceDiscount2().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getTvPriceDiscount2().setText(
						goods2.getDiscount() + mContext.getResources().getString(R.string.discount));
			}
			
			if (!TextUtils.isEmpty(goods2.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods2.getPicUrl(), holderItem2WithTitle.getIvPic2(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods2.getShowTag();
			switch(showTag) {
			case 1:
				holderItem2WithTitle.getShowTag2().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getShowTag2().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem2WithTitle.getShowTag2().setVisibility(View.VISIBLE);
				holderItem2WithTitle.getShowTag2().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem2WithTitle.getShowTag2().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods2.getStock() <= 0) {
				holderItem2WithTitle.getShowTagSoldOut2().setVisibility(View.VISIBLE);
			}
			else {
				holderItem2WithTitle.getShowTagSoldOut2().setVisibility(View.GONE);
			}

			holderItem2WithTitle.getTvPrice2().setVisibility(View.VISIBLE);
			holderItem2WithTitle.getIvPic2().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem2WithTitle.getTvPrice2().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getTvPriceDiscount2().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getIvPic2().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getShowTag2().setVisibility(View.INVISIBLE);
			holderItem2WithTitle.getShowTagSoldOut2().setVisibility(View.INVISIBLE);
		}

		return child;
	}

	public View getChildItemImage(int position, View convertView,
			ViewGroup parent) {
		ViewHolderItemImage holderItemImage = null;
		View child = convertView;
		if (child == null) {
			child = mLayoutInflater.inflate(R.layout.portal_item_image, null);
			holderItemImage = new ViewHolderItemImage(child);
			child.setTag(holderItemImage);
		} else {
			holderItemImage = (ViewHolderItemImage) child.getTag();
		}

		@SuppressWarnings("unchecked")
		List<UIGoodsRecommend> list = (List<UIGoodsRecommend>) (mDataList
				.get(position).mDataObj);
		holderItemImage.setRecommendList(list);
		
		int size = list.size();
		Log.d("CEXX", "CEXX ---> UIGoodsRecommend ---> size : " + size);

		holderItemImage.getShowTag0().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag1().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag2().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag3().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag4().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag5().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag6().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag7().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag8().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag9().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag10().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag11().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag12().setVisibility(View.INVISIBLE);
		holderItemImage.getShowTag13().setVisibility(View.INVISIBLE);
		boolean flag1 = false;
		boolean flag2 = false;
		boolean flag3 = false;
		boolean flag4 = false;
		boolean flag5 = false;
		boolean flag6 = false;
		boolean flag7 = false;
		boolean flag8 = false;
		boolean flag9 = false;
		boolean flag10 = false;
		boolean flag11 = false;
		boolean flag12 = false;
		boolean flag13 = false;
		boolean flag14 = false;
		for (UIGoodsRecommend gr : list) {
			String picUrl = gr.getPicUrl();
			if (TextUtils.isEmpty(picUrl)) {
				continue;
			}

			Goods goods = null;
			switch (gr.getShowIndex()) {
			case 1:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag0().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag0().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag0().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag0().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag0().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut0().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut0().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic0(),AntHomeApplication.imageDisplayOptions);
				flag1 = true;
				break;
			case 2:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag1().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag1().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag1().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag1().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag1().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut1().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut1().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic1(),AntHomeApplication.imageDisplayOptions);
				flag2 = true;
				break;
			case 3:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag2().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag2().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag2().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag2().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag2().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut2().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut2().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic2(),AntHomeApplication.imageDisplayOptions);
				flag3 = true;
				break;
			case 4:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag3().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag3().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag3().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag3().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag3().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut3().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut3().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic3(),AntHomeApplication.imageDisplayOptions);
				flag4 = true;
				break;
			case 5:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag4().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag4().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag4().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag4().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag4().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut4().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut4().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic4(),AntHomeApplication.imageDisplayOptions);
				flag5 = true;
				break;
			case 6:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag5().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag5().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag5().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag5().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag5().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut5().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut5().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic5(),AntHomeApplication.imageDisplayOptions);
				flag6 = true;
				break;
			case 7:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag6().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag6().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag6().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag6().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag6().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut6().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut6().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic6(),AntHomeApplication.imageDisplayOptions);
				flag7 = true;
				break;
			case 8:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag7().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag7().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag7().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag7().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag7().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut7().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut7().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic7(),AntHomeApplication.imageDisplayOptions);
				flag8 = true;
				break;
			case 9:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag8().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag8().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag8().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag8().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag8().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut8().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut8().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic8(),AntHomeApplication.imageDisplayOptions);
				flag9 = true;
				break;
			case 10:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag9().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag9().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag9().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag9().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag9().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut9().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut9().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic9(),AntHomeApplication.imageDisplayOptions);
				flag10 = true;
				break;
			case 11:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag10().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag10().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag10().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag10().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag10().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut10().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut10().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic10(),AntHomeApplication.imageDisplayOptions);
				flag11 = true;
				break;
			case 12:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag11().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag11().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag11().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag11().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag11().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut11().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut11().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic11(),AntHomeApplication.imageDisplayOptions);
				flag12 = true;
				break;
			case 13:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag12().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag12().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag12().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag12().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag12().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut12().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut12().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic12(),AntHomeApplication.imageDisplayOptions);
				flag13 = true;
				break;
			case 14:
				if(gr.getShowTag() == 1) {
					holderItemImage.getShowTag13().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag13().setBackgroundResource(R.drawable.show_tag_promotion);
				}
				else if(gr.getShowTag() == 2) {
					holderItemImage.getShowTag13().setVisibility(View.VISIBLE);
					holderItemImage.getShowTag13().setBackgroundResource(R.drawable.show_tag_hotsale);
				}
				else {
					holderItemImage.getShowTag13().setVisibility(View.INVISIBLE);
				}
				
				goods = gr.getGoods();
				if(gr.getShowTag() == 3 || (goods != null && goods.getStock() <= 0)) {
					holderItemImage.getShowTagSoldOut13().setVisibility(View.VISIBLE);
				}
				else {
					holderItemImage.getShowTagSoldOut13().setVisibility(View.GONE);
				}
				
				ImageLoader.getInstance().displayImage(picUrl, holderItemImage.getIvPic13(),AntHomeApplication.imageDisplayOptions);
				flag14 = true;
				break;
			}
		}
		
		if(flag1 || flag2 || flag3) {
			holderItemImage.getLayoutLine0().setVisibility(View.VISIBLE);
			if(!flag1) {
				holderItemImage.getShowTag0().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut0().setVisibility(View.GONE);
			}
			
			if(!flag2) {
				holderItemImage.getShowTag1().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut1().setVisibility(View.GONE);
			}
			
			if(!flag3) {
				holderItemImage.getShowTag2().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut2().setVisibility(View.GONE);
			}
		}
		else {
			holderItemImage.getLayoutLine0().setVisibility(View.GONE);
		}
		
		if(flag4) {
			holderItemImage.getLayoutLine1().setVisibility(View.VISIBLE);
		}
		else {
			holderItemImage.getLayoutLine1().setVisibility(View.GONE);
		}
		
		if(flag5 || flag6 || flag7) {
			holderItemImage.getLayoutLine2().setVisibility(View.VISIBLE);
			if(!flag5) {
				holderItemImage.getShowTag4().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut4().setVisibility(View.GONE);
			}
			
			if(!flag6) {
				holderItemImage.getShowTag5().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut5().setVisibility(View.GONE);
			}
			
			if(!flag7) {
				holderItemImage.getShowTag6().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut6().setVisibility(View.GONE);
			}
		}
		else {
			holderItemImage.getLayoutLine2().setVisibility(View.GONE);
		}
		
		if(flag8 || flag9) {
			holderItemImage.getLayoutLine3().setVisibility(View.VISIBLE);
			if(!flag8) {
				holderItemImage.getShowTag7().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut7().setVisibility(View.GONE);
			}
			
			if(!flag9) {
				holderItemImage.getShowTag8().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut8().setVisibility(View.GONE);
			}
		}
		else {
			holderItemImage.getLayoutLine3().setVisibility(View.GONE);
		}
		
		if(flag10) {
			holderItemImage.getLayoutLine4().setVisibility(View.VISIBLE);
		}
		else {
			holderItemImage.getLayoutLine4().setVisibility(View.GONE);
		}
		
		if(flag11 || flag12) {
			holderItemImage.getLayoutLine5().setVisibility(View.VISIBLE);
			if(!flag11) {
				holderItemImage.getShowTag10().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut10().setVisibility(View.GONE);
			}
			
			if(!flag12) {
				holderItemImage.getShowTag11().setVisibility(View.GONE);
				holderItemImage.getShowTagSoldOut11().setVisibility(View.GONE);
			}
		}
		else {
			holderItemImage.getLayoutLine5().setVisibility(View.GONE);
		}
		
		if(flag13) {
			holderItemImage.getLayoutLine6().setVisibility(View.VISIBLE);
		}
		else {
			holderItemImage.getLayoutLine6().setVisibility(View.GONE);
		}
		
		if(flag14) {
			holderItemImage.getLayoutLine7().setVisibility(View.VISIBLE);
		}
		else {
			holderItemImage.getLayoutLine7().setVisibility(View.GONE);
		}

		return child;
	}

	public View getChildItem3WithTitle(int position, View convertView,
			ViewGroup parent) {
		ViewHolderItem3WithTitle holderItem3WithTitle = null;
		View child = convertView;
		if (child == null) {
			child = mLayoutInflater.inflate(R.layout.portal_item_3_with_title,
					null);
			holderItem3WithTitle = new ViewHolderItem3WithTitle(child);
			child.setTag(holderItem3WithTitle);
		} else {
			holderItem3WithTitle = (ViewHolderItem3WithTitle) child.getTag();
		}
		
		PortalItemData itemData = mDataList.get(position);
		List<UIGoods> list = (List<UIGoods>)(itemData.mDataObj);
		holderItem3WithTitle.setUIGoodsList(list);
		
		int size = list.size();
		Log.d("CEXX", "CEXX ---> getChildItem3WithTitle --> UIGoods ---> size : " + size);
		
		View iconView = holderItem3WithTitle.getTitleIcon();
		TextView titleDesTv = holderItem3WithTitle.getTvTitleDes();
		String titleUrl = itemData.mTitleIconUrl;
		String titleDes = itemData.mTitleDes;
		if(!TextUtils.isEmpty(titleUrl)) {
			iconView.setVisibility(View.VISIBLE);
			titleDesTv.setVisibility(View.GONE);
			ImageLoader.getInstance().displayImage(titleUrl, holderItem3WithTitle.getTitleIcon(),AntHomeApplication.imageDisplayOptions);
		}
		else {
			iconView.setVisibility(View.GONE);
			titleDesTv.setVisibility(View.VISIBLE);
			titleDesTv.setText(titleDes==null ? "" : titleDes);
		}
		
		UIGoods goods0 = null;
		UIGoods goods1 = null;
		UIGoods goods2 = null;
		if(size > 0)
		{
			goods0 = list.get(0);
		}
		
		if(size > 1)
		{
			goods1 = list.get(1);
		}
		
		if(size > 2)
		{
			goods2 = list.get(2);
		}
		
		if(goods0 != null) {
			holderItem3WithTitle.getTvDes0().setText(goods0.getDescroptionAndSpecs());
			holderItem3WithTitle.getTvPrice0().setText(mDecimalFormat.format(goods0.getPriceAfterDiscount()));
			holderItem3WithTitle.getTvUnit0().setText(" / " + goods0.getUnit());
			holderItem3WithTitle.getTvPeopleCount0().setText(
					goods0.getBuyedPeopleCount() + mContext.getResources().getString(R.string.buyed_people_count));
			if (!TextUtils.isEmpty(goods0.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods0.getPicUrl(), holderItem3WithTitle.getIvPic0(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods0.getShowTag();
			switch(showTag) {
			case 1:
				holderItem3WithTitle.getShowTag0().setVisibility(View.VISIBLE);
				holderItem3WithTitle.getShowTag0().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem3WithTitle.getShowTag0().setVisibility(View.VISIBLE);
				holderItem3WithTitle.getShowTag0().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem3WithTitle.getShowTag0().setVisibility(View.INVISIBLE);
			}

			if(showTag == 3 || goods0.getStock() <= 0) {
				holderItem3WithTitle.getShowTagSoldOut0().setVisibility(View.VISIBLE);
			}
			else {
				holderItem3WithTitle.getShowTagSoldOut0().setVisibility(View.GONE);
			}
			
			holderItem3WithTitle.getViewLayoutItem0().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvDes0().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvPrice0().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvUnit0().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvPeopleCount0().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getIvPic0().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem3WithTitle.getViewLayoutItem0().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvDes0().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvPrice0().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvUnit0().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvPeopleCount0().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getIvPic0().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getShowTag0().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getShowTagSoldOut0().setVisibility(View.INVISIBLE);
		}
		
		if(goods1 != null) {
			holderItem3WithTitle.getTvDes1().setText(goods1.getDescroptionAndSpecs());
			holderItem3WithTitle.getTvPrice1().setText(mDecimalFormat.format(goods1.getPriceAfterDiscount()));
			holderItem3WithTitle.getTvUnit1().setText(" / " + goods1.getUnit());
			holderItem3WithTitle.getTvPeopleCount1().setText(
					goods1.getBuyedPeopleCount() + mContext.getResources().getString(R.string.buyed_people_count));
			if (!TextUtils.isEmpty(goods1.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods1.getPicUrl(), holderItem3WithTitle.getIvPic1(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods1.getShowTag();
			switch(showTag) {
			case 1:
				holderItem3WithTitle.getShowTag1().setVisibility(View.VISIBLE);
				holderItem3WithTitle.getShowTag1().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem3WithTitle.getShowTag1().setVisibility(View.VISIBLE);
				holderItem3WithTitle.getShowTag1().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem3WithTitle.getShowTag1().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods1.getStock() <= 0) {
				holderItem3WithTitle.getShowTagSoldOut1().setVisibility(View.VISIBLE);
			}
			else {
				holderItem3WithTitle.getShowTagSoldOut1().setVisibility(View.GONE);
			}

			holderItem3WithTitle.getViewLayoutItem1().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvDes1().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvPrice1().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvUnit1().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvPeopleCount1().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getIvPic1().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem3WithTitle.getViewLayoutItem1().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvDes1().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvPrice1().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvUnit1().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvPeopleCount1().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getIvPic1().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getShowTag1().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getShowTagSoldOut1().setVisibility(View.INVISIBLE);
		}
		
		if(goods2 != null) {
			holderItem3WithTitle.getTvDes2().setText(goods2.getDescroptionAndSpecs());
			holderItem3WithTitle.getTvPrice2().setText(mDecimalFormat.format(goods2.getPriceAfterDiscount()));
			holderItem3WithTitle.getTvUnit2().setText(" / " + goods2.getUnit());
			holderItem3WithTitle.getTvPeopleCount2().setText(
					goods2.getBuyedPeopleCount() + mContext.getResources().getString(R.string.buyed_people_count));
			if (!TextUtils.isEmpty(goods2.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods2.getPicUrl(), holderItem3WithTitle.getIvPic2(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods2.getShowTag();
			switch(showTag) {
			case 1:
				holderItem3WithTitle.getShowTag2().setVisibility(View.VISIBLE);
				holderItem3WithTitle.getShowTag2().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem3WithTitle.getShowTag2().setVisibility(View.VISIBLE);
				holderItem3WithTitle.getShowTag2().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem3WithTitle.getShowTag2().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods2.getStock() <= 0) {
				holderItem3WithTitle.getShowTagSoldOut2().setVisibility(View.VISIBLE);
			}
			else {
				holderItem3WithTitle.getShowTagSoldOut2().setVisibility(View.GONE);
			}

			holderItem3WithTitle.getViewLayoutItem2().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvDes2().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvPrice2().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvUnit2().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getTvPeopleCount2().setVisibility(View.VISIBLE);
			holderItem3WithTitle.getIvPic2().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem3WithTitle.getViewLayoutItem2().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvDes2().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvPrice2().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvUnit2().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getTvPeopleCount2().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getIvPic2().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getShowTag2().setVisibility(View.INVISIBLE);
			holderItem3WithTitle.getShowTagSoldOut2().setVisibility(View.INVISIBLE);
		}

		return child;
	}

	public View getChildItem3(int position, View convertView, ViewGroup parent) {
		ViewHolderItem3 holderItem3 = null;
		View child = convertView;
		if (child == null) {
			child = mLayoutInflater.inflate(R.layout.portal_item_3, null);
			holderItem3 = new ViewHolderItem3(child);
			child.setTag(holderItem3);
		} else {
			holderItem3 = (ViewHolderItem3) child.getTag();
		}
		
		List<UIGoods> list = (List<UIGoods>)(mDataList.get(position).mDataObj);
		holderItem3.setUIGoodsList(list);
		
		int size = list.size();
		Log.d("CEXX", "CEXX ---> getChildItem3 --> UIGoods ---> size : " + size);
		
		UIGoods goods0 = null;
		UIGoods goods1 = null;
		UIGoods goods2 = null;
		if(size > 0)
		{
			goods0 = list.get(0);
		}
		
		if(size > 1)
		{
			goods1 = list.get(1);
		}
		
		if(size > 2)
		{
			goods2 = list.get(2);
		}
		
		if(goods0 != null) {
			holderItem3.getTvDes0().setText(goods0.getDescroptionAndSpecs());
			holderItem3.getTvPrice0().setText(mDecimalFormat.format(goods0.getPriceAfterDiscount()));
			holderItem3.getTvUnit0().setText(" / " + goods0.getUnit());
			holderItem3.getTvPeopleCount0().setText(
					goods0.getBuyedPeopleCount() + mContext.getResources().getString(R.string.buyed_people_count));
			if (!TextUtils.isEmpty(goods0.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods0.getPicUrl(), holderItem3.getIvPic0(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods0.getShowTag();
			switch(showTag) {
			case 1:
				holderItem3.getShowTag0().setVisibility(View.VISIBLE);
				holderItem3.getShowTag0().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem3.getShowTag0().setVisibility(View.VISIBLE);
				holderItem3.getShowTag0().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem3.getShowTag0().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods0.getStock() <= 0) {
				holderItem3.getShowTagSoldOut0().setVisibility(View.VISIBLE);
			}
			else {
				holderItem3.getShowTagSoldOut0().setVisibility(View.GONE);
			}

			holderItem3.getViewLayoutItem0().setVisibility(View.VISIBLE);
			holderItem3.getTvDes0().setVisibility(View.VISIBLE);
			holderItem3.getTvPrice0().setVisibility(View.VISIBLE);
			holderItem3.getTvUnit0().setVisibility(View.VISIBLE);
			holderItem3.getTvPeopleCount0().setVisibility(View.VISIBLE);
			holderItem3.getIvPic0().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem3.getViewLayoutItem0().setVisibility(View.INVISIBLE);
			holderItem3.getTvDes0().setVisibility(View.INVISIBLE);
			holderItem3.getTvPrice0().setVisibility(View.INVISIBLE);
			holderItem3.getTvUnit0().setVisibility(View.INVISIBLE);
			holderItem3.getTvPeopleCount0().setVisibility(View.INVISIBLE);
			holderItem3.getIvPic0().setVisibility(View.INVISIBLE);
			holderItem3.getShowTag0().setVisibility(View.INVISIBLE);
			holderItem3.getShowTagSoldOut0().setVisibility(View.INVISIBLE);
		}
		
		if(goods1 != null) {
			holderItem3.getTvDes1().setText(goods1.getDescroptionAndSpecs());
			holderItem3.getTvPrice1().setText(mDecimalFormat.format(goods1.getPriceAfterDiscount()));
			holderItem3.getTvUnit1().setText(" / " + goods1.getUnit());
			holderItem3.getTvPeopleCount1().setText(
					goods1.getBuyedPeopleCount() + mContext.getResources().getString(R.string.buyed_people_count));
			if (!TextUtils.isEmpty(goods1.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods1.getPicUrl(), holderItem3.getIvPic1(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods1.getShowTag();
			switch(showTag) {
			case 1:
				holderItem3.getShowTag1().setVisibility(View.VISIBLE);
				holderItem3.getShowTag1().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem3.getShowTag1().setVisibility(View.VISIBLE);
				holderItem3.getShowTag1().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem3.getShowTag1().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods1.getStock() <= 0) {
				holderItem3.getShowTagSoldOut1().setVisibility(View.VISIBLE);
			}
			else {
				holderItem3.getShowTagSoldOut1().setVisibility(View.GONE);
			}

			holderItem3.getViewLayoutItem1().setVisibility(View.VISIBLE);
			holderItem3.getTvDes1().setVisibility(View.VISIBLE);
			holderItem3.getTvPrice1().setVisibility(View.VISIBLE);
			holderItem3.getTvUnit1().setVisibility(View.VISIBLE);
			holderItem3.getTvPeopleCount1().setVisibility(View.VISIBLE);
			holderItem3.getIvPic1().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem3.getViewLayoutItem1().setVisibility(View.INVISIBLE);
			holderItem3.getTvDes1().setVisibility(View.INVISIBLE);
			holderItem3.getTvPrice1().setVisibility(View.INVISIBLE);
			holderItem3.getTvUnit1().setVisibility(View.INVISIBLE);
			holderItem3.getTvPeopleCount1().setVisibility(View.INVISIBLE);
			holderItem3.getIvPic1().setVisibility(View.INVISIBLE);
			holderItem3.getShowTag1().setVisibility(View.INVISIBLE);
			holderItem3.getShowTagSoldOut1().setVisibility(View.INVISIBLE);
		}
		
		if(goods2 != null) {
			holderItem3.getTvDes2().setText(goods2.getDescroptionAndSpecs());
			holderItem3.getTvPrice2().setText(mDecimalFormat.format(goods2.getPriceAfterDiscount()));
			holderItem3.getTvUnit2().setText(" / " + goods2.getUnit());
			holderItem3.getTvPeopleCount2().setText(
					goods2.getBuyedPeopleCount() + mContext.getResources().getString(R.string.buyed_people_count));
			if (!TextUtils.isEmpty(goods2.getPicUrl())) {
			    ImageLoader.getInstance().displayImage(goods2.getPicUrl(), holderItem3.getIvPic2(),AntHomeApplication.imageDisplayOptions);
			}
			
			int showTag = goods2.getShowTag();
			switch(showTag) {
			case 1:
				holderItem3.getShowTag2().setVisibility(View.VISIBLE);
				holderItem3.getShowTag2().setBackgroundResource(R.drawable.show_tag_promotion);
				break;
			case 2:
				holderItem3.getShowTag2().setVisibility(View.VISIBLE);
				holderItem3.getShowTag2().setBackgroundResource(R.drawable.show_tag_hotsale);
				break;
			default:
				holderItem3.getShowTag2().setVisibility(View.INVISIBLE);
			}
			
			if(showTag == 3 || goods2.getStock() <= 0) {
				holderItem3.getShowTagSoldOut2().setVisibility(View.VISIBLE);
			}
			else {
				holderItem3.getShowTagSoldOut2().setVisibility(View.GONE);
			}

			holderItem3.getViewLayoutItem2().setVisibility(View.VISIBLE);
			holderItem3.getTvDes2().setVisibility(View.VISIBLE);
			holderItem3.getTvPrice2().setVisibility(View.VISIBLE);
			holderItem3.getTvUnit2().setVisibility(View.VISIBLE);
			holderItem3.getTvPeopleCount2().setVisibility(View.VISIBLE);
			holderItem3.getIvPic2().setVisibility(View.VISIBLE);
		}
		else
		{
			holderItem3.getViewLayoutItem2().setVisibility(View.INVISIBLE);
			holderItem3.getTvDes2().setVisibility(View.INVISIBLE);
			holderItem3.getTvPrice2().setVisibility(View.INVISIBLE);
			holderItem3.getTvUnit2().setVisibility(View.INVISIBLE);
			holderItem3.getTvPeopleCount2().setVisibility(View.INVISIBLE);
			holderItem3.getIvPic2().setVisibility(View.INVISIBLE);
			holderItem3.getShowTag2().setVisibility(View.INVISIBLE);
			holderItem3.getShowTagSoldOut2().setVisibility(View.INVISIBLE);
		}

		return child;
	}

	// Banners
	private class ViewHolderBanners implements OnClickListener, OnPageChangeListener, OnGestureListener {
		private View mContentView;
		private MyViewPager mViewPager;
		private LinearLayout mLLPointsContainer;
		private List<UIBanners> mAntBanners;
		private Map<View, UIBanners> mMap;
		private int mPointWidth;
		private int mPointMargin;
		
		private Timer mTimer;
		private Handler mHandler = new Handler(Looper.getMainLooper());
		
		private boolean canMove = true;
		private boolean canClick = false;
		private int mCurrentPos;

		public ViewHolderBanners(View contentView) {
			mContentView = contentView;
			mViewPager = (MyViewPager) mContentView.findViewById(R.id.portal_vp_poster);
			mViewPager.setOnPageChangeListener(this);
			mViewPager.setOnGestureListener(this);
			mLLPointsContainer = (LinearLayout)mContentView.findViewById(R.id.portal_points_container);
			mAntBanners = new ArrayList<UIBanners>();
			mMap = new HashMap<View, UIBanners>();
			mPointWidth = mContext.getResources().getDimensionPixelOffset(R.dimen.portal_vp_poster_points_width);
			mPointMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.portal_vp_poster_points_margin);
		}

		public void setData(List<UIBanners> antBanners) {
			boolean sameData = true;
			if(antBanners == null) {
				if(mAntBanners.size() > 0) {
					sameData = false;
				}
			}
			if(antBanners != null) {
				if(antBanners.size() != mAntBanners.size()) {
					sameData = false;
				}
				else {
					for(UIBanners uiBanners : antBanners) {
						if(!mAntBanners.contains(uiBanners)) {
							sameData = false;
							break;
						}
					}
				}
			}
			
			Log.d("CEXX", "ViewHolderBanners ---> setData ---> sameData : " + sameData);
			if(!sameData){
				mCurrentPos = 0;
				mMap.clear();
				mAntBanners.clear();
				mAntBanners.addAll(antBanners);
				Log.d("CEXX", "ViewHolderBanners ---> setData ---> mAntBanners : " + mAntBanners.size());
				mViewPager.setAdapter(new MPagerAdapter());
				mLLPointsContainer.removeAllViews();
				for (UIBanners uab : antBanners) {
					View pointView = new View(mContext);
					pointView.setBackgroundResource(R.drawable.selector_banners_points);
					if(antBanners.indexOf(uab) == mViewPager.getCurrentItem()) {
						pointView.setSelected(true);
					}
					else {
						pointView.setSelected(false);
					}
					android.widget.LinearLayout.LayoutParams lpPointView = 
							new android.widget.LinearLayout.LayoutParams(mPointWidth, mPointWidth);
					lpPointView.setMargins(0, 0, mPointMargin, 0);
					mLLPointsContainer.addView(pointView, lpPointView);
				}
				
				if(mTimer != null) {
					mTimer.cancel();
				}
				if(antBanners.size() > 1) {
					mTimer = new Timer();
					mTimer.schedule(new TimerTask() {
						@Override
						public void run() {
							mHandler.post(new Runnable() {
								@Override
								public void run() {
									Log.d("CEXX", "ViewHolderBanners ---> TimerTask ---> canMove : " + canMove);
									if(canMove) {
										int size = mAntBanners.size();
										int currentPos = mViewPager.getCurrentItem();
										currentPos = (currentPos==(size-1) ? 0 : ++currentPos);
										mViewPager.setCurrentItem(currentPos);
									}
								}
							});
						}
					}, 5000, 5000);
				}
			}
		}

		@Override
		public void onClick(View v) {
			Log.d("CEXX", "ViewHolderBanners ---> onClick ---> canClick : " + canClick);
			if(canClick) {
				UIBanners banners = mMap.get(v);
				if(banners != null) {
					List<UIGoods> uiGoodsList = banners.getUIGoodsList();
					Log.d("CEXX", "ViewHolderBanners ---> onClick ---> uiGoodsList : " + (uiGoodsList==null ? uiGoodsList : uiGoodsList.size()));
					if(uiGoodsList != null && uiGoodsList.size() > 0) {
						ArrayList<UIGoods> arrayList = new ArrayList<UIGoods>();
						arrayList.addAll(uiGoodsList);
						Intent intent = new Intent(mContext, GoodsListActivity.class);
						intent.putExtra(GoodsListActivity.KEY_LIST_TYPE, GoodsListActivity.LIST_TYPE_FOR_HOME_PAGE_BANNERS);
						intent.putExtra(GoodsListActivity.KEY_GOODS_LIST, arrayList);
						mContext.startActivity(intent);
					}
				}
			}
		}
		
		private class MPagerAdapter extends PagerAdapter {
			private ArrayList<ImageView> mImageViewList = new ArrayList<ImageView>();

			@Override
			public void destroyItem(ViewGroup container, int position, Object object) {
				ImageView iv = mImageViewList.get(position);
				container.removeView(iv);
				mMap.remove(iv);
			}

			@Override
			public Object instantiateItem(ViewGroup container, int position) {
				ImageView iv = null;
				if(mImageViewList.size() - 1 > position) {
					iv = mImageViewList.get(position);
				}
				
				if (iv == null) {
					iv = new ImageView(mContext);
					iv.setOnClickListener(ViewHolderBanners.this);
					iv.setScaleType(ScaleType.FIT_XY);
					iv.setBackgroundResource(R.color.protal_item_color);
					mImageViewList.add(iv);
				}

				UIBanners uiBanner =mAntBanners.get(position);
				mMap.put(iv, uiBanner);
				ImageLoader.getInstance().displayImage(uiBanner.getPosterUrl(), iv,AntHomeApplication.imageDisplayOptions);
				((ViewPager) container).addView(iv, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
				return iv;
			}

			@Override
			public boolean isViewFromObject(View arg0, Object arg1) {
				return arg0 == arg1;
			}

			@Override
			public int getCount() {
				if (mAntBanners != null) {
					return mAntBanners.size();
				}
				return 0;
			}
		};

		@Override
		public void onPageScrollStateChanged(int arg0) {
			if(arg0 == 1) {
				canMove = false;
				canClick = true;
				mCurrentPos = mViewPager.getCurrentItem();
			}
			else if(arg0 == 0) {
				canMove = true;
			}
			Log.d("CEXX", "ViewHolderBanners ---> onPageScrollStateChanged ---> arg0 : " + arg0);
		}

		@Override
		public void onPageScrolled(int arg0, float arg1, int arg2) {
			Log.d("CEXX", "ViewHolderBanners ---> onPageScrolled ---> arg0 : " + arg0);
			Log.d("CEXX", "ViewHolderBanners ---> onPageScrolled ---> arg1 : " + arg1);
			Log.d("CEXX", "ViewHolderBanners ---> onPageScrolled ---> arg2 : " + arg2);
		}

		@Override
		public void onPageSelected(int arg0) {
			int size = mAntBanners.size();
			if(size > 1) {
				View child = mLLPointsContainer.getChildAt(mCurrentPos);
				if(child != null) {
					child.setSelected(false);
				}
				
				mCurrentPos = mViewPager.getCurrentItem();
				child = mLLPointsContainer.getChildAt(mCurrentPos);
				if(child != null) {
					child.setSelected(true);
				}
			}
		}

		@Override
		public boolean onDown(MotionEvent e) {
			return false;
		}

		@Override
		public void onShowPress(MotionEvent e) {
		}

		@Override
		public boolean onSingleTapUp(MotionEvent e) {
			return false;
		}

		@Override
		public boolean onScroll(MotionEvent e1, MotionEvent e2,
				float distanceX, float distanceY) {
			canClick = false;
			return false;
		}

		@Override
		public void onLongPress(MotionEvent e) {
		}

		@Override
		public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
				float velocityY) {
			return false;
		}
	}
	
	// Notice
	private class ViewHolderNotice implements OnClickListener {
		private View mContentView;
		private View mViewForClick;
		private TextView mTvNotice;
		private int mPosition;
		
		public ViewHolderNotice(View contentView) {
			mContentView = contentView;
			mViewForClick = mContentView.findViewById(R.id.portal_item_notice_rl);
			mViewForClick.setOnClickListener(this);
		}
		
		public void setPosition(int position) {
			this.mPosition = position;
		}

		public TextView getTvNotice() {
			if(mTvNotice == null) {
				mTvNotice = (TextView)mContentView.findViewById(R.id.portal_item_notice_tv);
			}
			return mTvNotice;
		}

		@Override
		public void onClick(View v) {
			if(v.equals(mViewForClick)) {
				PortalItemData itemData = mDataList.get(mPosition);
				if(itemData != null && itemData.mType == PortalItemData.TYPE_NOTICE) {
					if(mContext != null && itemData.mDataObj != null && itemData.mDataObj instanceof String) {
						new PortalNoticeDialog((Activity)mContext, (String)(itemData.mDataObj)).show();
					}
				}
			}
		}
	}
	
	// TradeStyle
	private class ViewHolderTrade implements OnClickListener {
		private View mContentView;
		private LinearLayout mLinearLayoutItem_0;
		private LinearLayout mLinearLayoutItem_1;
		private LinearLayout mLinearLayoutItem_2;
		private LinearLayout mLinearLayoutItem_3;
		private ImageView mIvCircle_0;
		private ImageView mIvCircle_1;
		private ImageView mIvCircle_2;
		private ImageView mIvCircle_3;
		private TextView mTvDes_0;
		private TextView mTvDes_1;
		private TextView mTvDes_2;
		private TextView mTvDes_3;
		
		private List<UIGoodsCategory> mUIGoodsCategoryList;

		public ViewHolderTrade(View contentView) {
			mContentView = contentView;
		}
		
		public void setUIGoodsCategoryList(List<UIGoodsCategory> list) {
			mUIGoodsCategoryList = list;
		}

		public LinearLayout getLinearLayoutItem_0() {
			if (mLinearLayoutItem_0 == null) {
				mLinearLayoutItem_0 = (LinearLayout) mContentView
						.findViewById(R.id.portal_categories_item_0);
				mLinearLayoutItem_0.setOnClickListener(this);
			}
			return mLinearLayoutItem_0;
		}

		public LinearLayout getLinearLayoutItem_1() {
			if (mLinearLayoutItem_1 == null) {
				mLinearLayoutItem_1 = (LinearLayout) mContentView
						.findViewById(R.id.portal_categories_item_1);
				mLinearLayoutItem_1.setOnClickListener(this);
			}
			return mLinearLayoutItem_1;
		}

		public LinearLayout getLinearLayoutItem_2() {
			if (mLinearLayoutItem_2 == null) {
				mLinearLayoutItem_2 = (LinearLayout) mContentView
						.findViewById(R.id.portal_categories_item_2);
				mLinearLayoutItem_2.setOnClickListener(this);
			}
			return mLinearLayoutItem_2;
		}

		public LinearLayout getLinearLayoutItem_3() {
			if (mLinearLayoutItem_3 == null) {
				mLinearLayoutItem_3 = (LinearLayout) mContentView
						.findViewById(R.id.portal_categories_item_3);
				mLinearLayoutItem_3.setOnClickListener(this);
			}
			return mLinearLayoutItem_3;
		}

		public ImageView getIvCircle_0() {
			if (mIvCircle_0 == null) {
				mIvCircle_0 = (ImageView) mContentView
						.findViewById(R.id.portal_categories_item_circle_0);
			}
			return mIvCircle_0;
		}

		public ImageView getIvCircle_1() {
			if (mIvCircle_1 == null) {
				mIvCircle_1 = (ImageView) mContentView
						.findViewById(R.id.portal_categories_item_circle_1);
			}
			return mIvCircle_1;
		}

		public ImageView getIvCircle_2() {
			if (mIvCircle_2 == null) {
				mIvCircle_2 = (ImageView) mContentView
						.findViewById(R.id.portal_categories_item_circle_2);
			}
			return mIvCircle_2;
		}

		public ImageView getIvCircle_3() {
			if (mIvCircle_3 == null) {
				mIvCircle_3 = (ImageView) mContentView
						.findViewById(R.id.portal_categories_item_circle_3);
			}
			return mIvCircle_3;
		}

		public TextView getTvDes_0() {
			if (mTvDes_0 == null) {
				mTvDes_0 = (TextView) mContentView
						.findViewById(R.id.portal_categories_item_des_0);
			}
			return mTvDes_0;
		}

		public TextView getTvDes_1() {
			if (mTvDes_1 == null) {
				mTvDes_1 = (TextView) mContentView
						.findViewById(R.id.portal_categories_item_des_1);
			}
			return mTvDes_1;
		}

		public TextView getTvDes_2() {
			if (mTvDes_2 == null) {
				mTvDes_2 = (TextView) mContentView
						.findViewById(R.id.portal_categories_item_des_2);
			}
			return mTvDes_2;
		}

		public TextView getTvDes_3() {
			if (mTvDes_3 == null) {
				mTvDes_3 = (TextView) mContentView
						.findViewById(R.id.portal_categories_item_des_3);
			}
			return mTvDes_3;
		}

		@Override
		public void onClick(View v) {
			UIGoodsCategory uiGoodsCategory = null;
			try{
				if(v.equals(mLinearLayoutItem_0))
				{
					uiGoodsCategory = mUIGoodsCategoryList.get(0);
				}
				else if(v.equals(mLinearLayoutItem_1))
				{
					uiGoodsCategory = mUIGoodsCategoryList.get(1);
				}
				else if(v.equals(mLinearLayoutItem_2))
				{
					uiGoodsCategory = mUIGoodsCategoryList.get(2);
				}
				else if(v.equals(mLinearLayoutItem_3))
				{
					uiGoodsCategory = mUIGoodsCategoryList.get(3);
				}
			}
			catch(Exception e){
				e.printStackTrace();
			}
			
			Log.d("CEXX", "CEXX ---> onClick ---> uiGoodsCategory : " + uiGoodsCategory);
			if(uiGoodsCategory != null) {
				Log.d("CEXX", "CEXX ---> UIGoodsCategory show style : " + uiGoodsCategory.getShowStyle());
				if(UIGoodsCategory.SHOW_SP.equals(uiGoodsCategory.getShowStyle())) {
					Log.d("CEXX", "CEXX ---> UIGoodsCategory.SHOW_SP");
					
					ArrayList<String> goodsStylesNameList = new ArrayList<String>();
					List<GoodsStyles> goodsStylesList = uiGoodsCategory.getGoodsStylesList();
					if(goodsStylesList != null) {
						for(GoodsStyles gs : goodsStylesList) {
							goodsStylesNameList.add(gs.getName());
						}
					}
					
					Intent intent = new Intent(mContext, GoodsListTradeStyleActivity.class);
					intent.putExtra(GoodsListTradeStyleActivity.KEY_GOODS_STYLES_LIST, goodsStylesNameList);
					mContext.startActivity(intent);
				}
				else if(UIGoodsCategory.SHOW_STORES.equals(uiGoodsCategory.getShowStyle())) {
					Log.d("CEXX", "CEXX ---> UIGoodsCategory.SHOW_STORES");
					ServerSection us = UtilTools.getServerSection(AntHomeApplication.context);
					String objectId = us.getObjectId();
					Log.d("CEXX", "CEXX ---> UIGoodsCategory.SHOW_STORES ---> objectId : " + objectId);
					if(!TextUtils.isEmpty(objectId)) {
						Intent intent = new Intent(mContext, ActivityIndependentStoreHome.class);
						intent.putExtra("mySection", objectId);
						mContext.startActivity(intent);
					}
				}
			}
		}
	}

	// HomePageItems(itme1) with title
	private class ViewHolderItem1WithTitle implements OnClickListener{
		private View mContentView;
		private ImageView mTitleIcon;
		private View mShowTag0;
		private View mShowTag1;
		private View mShowTag2;
		private View mShowTagSoldOut0;
		private View mShowTagSoldOut1;
		private View mShowTagSoldOut2;
		private ImageView mIvPic0;
		private ImageView mIvPic1;
		private ImageView mIvPic2;
		private TextView mTvTitleDes;
		private TextView mTvMore;
		private TextView mTvPrice0;
		private TextView mTvPrice1;
		private TextView mTvPrice2;
		private TextView mTvPricePrevious0;
		private TextView mTvPricePrevious1;
		private TextView mTvPricePrevious2;
		
		private ArrayList<UIGoods> mUIGoodsList = new ArrayList<UIGoods>();

		public ViewHolderItem1WithTitle(View contentView) {
			mContentView = contentView;
			mTvMore = (TextView)mContentView.findViewById(R.id.portal_item_1_with_title_tv_more);
			mTvMore.setOnClickListener(this);
		}
		
		public void setUIGoodsList(List<UIGoods> list) {
			mUIGoodsList.clear();
			if(list != null) {
				this.mUIGoodsList.addAll(list);
			}
		}

		public ImageView getTitleIcon() {
			if (mTitleIcon == null) {
				mTitleIcon = (ImageView)mContentView
						.findViewById(R.id.portal_item_1_with_title_icon);
			}
			return mTitleIcon;
		}
		
		public TextView getTvTitleDes() {
			if (mTvTitleDes == null) {
				mTvTitleDes = (TextView)mContentView
						.findViewById(R.id.portal_item_1_with_title_des);
			}
			return mTvTitleDes;
		}
		
		public View getShowTag0() {
			if (mShowTag0 == null) {
				mShowTag0 = mContentView.findViewById(R.id.portal_item_1_with_title_0_show_tag);
				mShowTag0.setOnClickListener(this);
			}
			return mShowTag0;
		}
		
		public View getShowTag1() {
			if (mShowTag1 == null) {
				mShowTag1 = mContentView.findViewById(R.id.portal_item_1_with_title_1_show_tag);
				mShowTag1.setOnClickListener(this);
			}
			return mShowTag1;
		}
		
		public View getShowTag2() {
			if (mShowTag2 == null) {
				mShowTag2 = mContentView.findViewById(R.id.portal_item_1_with_title_2_show_tag);
				mShowTag2.setOnClickListener(this);
			}
			return mShowTag2;
		}
		
		public View getShowTagSoldOut0() {
			if (mShowTagSoldOut0 == null) {
				mShowTagSoldOut0 = mContentView.findViewById(R.id.portal_item_1_with_title_0_show_tag_sold_out);
				mShowTagSoldOut0.setOnClickListener(this);
			}
			return mShowTagSoldOut0;
		}
		
		public View getShowTagSoldOut1() {
			if (mShowTagSoldOut1 == null) {
				mShowTagSoldOut1 = mContentView.findViewById(R.id.portal_item_1_with_title_1_show_tag_sold_out);
				mShowTagSoldOut1.setOnClickListener(this);
			}
			return mShowTagSoldOut1;
		}
		
		public View getShowTagSoldOut2() {
			if (mShowTagSoldOut2 == null) {
				mShowTagSoldOut2 = mContentView.findViewById(R.id.portal_item_1_with_title_2_show_tag_sold_out);
				mShowTagSoldOut2.setOnClickListener(this);
			}
			return mShowTagSoldOut2;
		}

		public ImageView getIvPic0() {
			if (mIvPic0 == null) {
				mIvPic0 = (ImageView) mContentView
						.findViewById(R.id.portal_item_1_with_title_0_pic);
				mIvPic0.setOnClickListener(this);
			}
			return mIvPic0;
		}

		public ImageView getIvPic1() {
			if (mIvPic1 == null) {
				mIvPic1 = (ImageView) mContentView
						.findViewById(R.id.portal_item_1_with_title_1_pic);
				mIvPic1.setOnClickListener(this);
			}
			return mIvPic1;
		}

		public ImageView getIvPic2() {
			if (mIvPic2 == null) {
				mIvPic2 = (ImageView) mContentView
						.findViewById(R.id.portal_item_1_with_title_2_pic);
				mIvPic2.setOnClickListener(this);
			}
			return mIvPic2;
		}

		public TextView getTvPrice0() {
			if (mTvPrice0 == null) {
				mTvPrice0 = (TextView) mContentView
						.findViewById(R.id.portal_item_1_with_title_0_price);
			}
			return mTvPrice0;
		}

		public TextView getTvPrice1() {
			if (mTvPrice1 == null) {
				mTvPrice1 = (TextView) mContentView
						.findViewById(R.id.portal_item_1_with_title_1_price);
			}
			return mTvPrice1;
		}

		public TextView getTvPrice2() {
			if (mTvPrice2 == null) {
				mTvPrice2 = (TextView) mContentView
						.findViewById(R.id.portal_item_1_with_title_2_price);
			}
			return mTvPrice2;
		}
		
		public TextView getTvPricePrevious0() {
			if (mTvPricePrevious0 == null) {
				mTvPricePrevious0 = (TextView) mContentView
						.findViewById(R.id.portal_item_1_with_title_0_price_previous);
			}
			return mTvPricePrevious0;
		}

		public TextView getTvPricePrevious1() {
			if (mTvPricePrevious1 == null) {
				mTvPricePrevious1 = (TextView) mContentView
						.findViewById(R.id.portal_item_1_with_title_1_price_previous);
			}
			return mTvPricePrevious1;
		}

		public TextView getTvPricePrevious2() {
			if (mTvPricePrevious2 == null) {
				mTvPricePrevious2 = (TextView) mContentView
						.findViewById(R.id.portal_item_1_with_title_2_price_previous);
			}
			return mTvPricePrevious2;
		}

		@Override
		public void onClick(View v) {
			if(v.equals(mTvMore)) {
				Intent intent = new Intent(mContext, GoodsListActivity.class);
				intent.putExtra(GoodsListActivity.KEY_LIST_TYPE, GoodsListActivity.LIST_TYPE_FOR_HOME_PAGE_ITEM_1);
				intent.putExtra(GoodsListActivity.KEY_GOODS_LIST, mUIGoodsList);
				mContext.startActivity(intent);
			}
			else if(v.equals(mIvPic0) || v.equals(mShowTag0) || v.equals(mShowTagSoldOut0)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(0);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
			else if(v.equals(mIvPic1) || v.equals(mShowTag1) || v.equals(mShowTagSoldOut1)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(1);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
			else if(v.equals(mIvPic2) || v.equals(mShowTag2) || v.equals(mShowTagSoldOut2)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(2);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
		}
	}

	// HomePageItems(itme2) with title
	private class ViewHolderItem2WithTitle implements OnClickListener {
		private View mContentView;
		private ImageView mTitleIcon;
		private View mShowTag0;
		private View mShowTag1;
		private View mShowTag2;
		private View mShowTagSoldOut0;
		private View mShowTagSoldOut1;
		private View mShowTagSoldOut2;
		private ImageView mIvPic0;
		private ImageView mIvPic1;
		private ImageView mIvPic2;
		private TextView mTvTitleDes;
		private TextView mTvMore;
		private TextView mTvPrice0;
		private TextView mTvPrice1;
		private TextView mTvPrice2;
		private TextView mTvPriceDiscount0;
		private TextView mTvPriceDiscount1;
		private TextView mTvPriceDiscount2;
		
		private ArrayList<UIGoods> mUIGoodsList = new ArrayList<UIGoods>();

		public ViewHolderItem2WithTitle(View contentView) {
			mContentView = contentView;
			mTvMore = (TextView)mContentView.findViewById(R.id.portal_item_2_with_title_tv_more);
			mTvMore.setOnClickListener(this);
		}
		
		public void setUIGoodsList(List<UIGoods> list) {
			mUIGoodsList.clear();
			if(list != null) {
				this.mUIGoodsList.addAll(list);
			}
		}

		public ImageView getTitleIcon() {
			if (mTitleIcon == null) {
				mTitleIcon = (ImageView)mContentView
						.findViewById(R.id.portal_item_2_with_title_icon);
			}
			return mTitleIcon;
		}
		
		public TextView getTvTitleDes() {
			if (mTvTitleDes == null) {
				mTvTitleDes = (TextView)mContentView
						.findViewById(R.id.portal_item_2_with_title_des);
			}
			return mTvTitleDes;
		}
		
		public View getShowTag0() {
			if (mShowTag0 == null) {
				mShowTag0 = mContentView.findViewById(R.id.portal_item_2_with_title_0_show_tag);
				mShowTag0.setOnClickListener(this);
			}
			return mShowTag0;
		}
		
		public View getShowTag1() {
			if (mShowTag1 == null) {
				mShowTag1 = mContentView.findViewById(R.id.portal_item_2_with_title_1_show_tag);
				mShowTag1.setOnClickListener(this);
			}
			return mShowTag1;
		}
		
		public View getShowTag2() {
			if (mShowTag2 == null) {
				mShowTag2 = mContentView.findViewById(R.id.portal_item_2_with_title_2_show_tag);
				mShowTag2.setOnClickListener(this);
			}
			return mShowTag2;
		}
		
		public View getShowTagSoldOut0() {
			if (mShowTagSoldOut0 == null) {
				mShowTagSoldOut0 = mContentView.findViewById(R.id.portal_item_2_with_title_0_show_tag_sold_out);
				mShowTagSoldOut0.setOnClickListener(this);
			}
			return mShowTagSoldOut0;
		}
		
		public View getShowTagSoldOut1() {
			if (mShowTagSoldOut1 == null) {
				mShowTagSoldOut1 = mContentView.findViewById(R.id.portal_item_2_with_title_1_show_tag_sold_out);
				mShowTagSoldOut1.setOnClickListener(this);
			}
			return mShowTagSoldOut1;
		}
		
		public View getShowTagSoldOut2() {
			if (mShowTagSoldOut2 == null) {
				mShowTagSoldOut2 = mContentView.findViewById(R.id.portal_item_2_with_title_2_show_tag_sold_out);
				mShowTagSoldOut2.setOnClickListener(this);
			}
			return mShowTagSoldOut2;
		}

		public ImageView getIvPic0() {
			if (mIvPic0 == null) {
				mIvPic0 = (ImageView) mContentView
						.findViewById(R.id.portal_item_2_with_title_0_pic);
				mIvPic0.setOnClickListener(this);
			}
			return mIvPic0;
		}

		public ImageView getIvPic1() {
			if (mIvPic1 == null) {
				mIvPic1 = (ImageView) mContentView
						.findViewById(R.id.portal_item_2_with_title_1_pic);
				mIvPic1.setOnClickListener(this);
			}
			return mIvPic1;
		}

		public ImageView getIvPic2() {
			if (mIvPic2 == null) {
				mIvPic2 = (ImageView) mContentView
						.findViewById(R.id.portal_item_2_with_title_2_pic);
				mIvPic2.setOnClickListener(this);
			}
			return mIvPic2;
		}

		public TextView getTvPrice0() {
			if (mTvPrice0 == null) {
				mTvPrice0 = (TextView) mContentView
						.findViewById(R.id.portal_item_2_with_title_0_price);
			}
			return mTvPrice0;
		}

		public TextView getTvPrice1() {
			if (mTvPrice1 == null) {
				mTvPrice1 = (TextView) mContentView
						.findViewById(R.id.portal_item_2_with_title_1_price);
			}
			return mTvPrice1;
		}

		public TextView getTvPrice2() {
			if (mTvPrice2 == null) {
				mTvPrice2 = (TextView) mContentView
						.findViewById(R.id.portal_item_2_with_title_2_price);
			}
			return mTvPrice2;
		}
		
		public TextView getTvPriceDiscount0() {
			if (mTvPriceDiscount0 == null) {
				mTvPriceDiscount0 = (TextView) mContentView
						.findViewById(R.id.portal_item_2_with_title_0_price_discount);
			}
			return mTvPriceDiscount0;
		}

		public TextView getTvPriceDiscount1() {
			if (mTvPriceDiscount1 == null) {
				mTvPriceDiscount1 = (TextView) mContentView
						.findViewById(R.id.portal_item_2_with_title_1_price_discount);
			}
			return mTvPriceDiscount1;
		}

		public TextView getTvPriceDiscount2() {
			if (mTvPriceDiscount2 == null) {
				mTvPriceDiscount2 = (TextView) mContentView
						.findViewById(R.id.portal_item_2_with_title_2_price_discount);
			}
			return mTvPriceDiscount2;
		}

		@Override
		public void onClick(View v) {
			if(v.equals(mTvMore)) {
				Intent intent = new Intent(mContext, GoodsListActivity.class);
				intent.putExtra(GoodsListActivity.KEY_LIST_TYPE, GoodsListActivity.LIST_TYPE_FOR_HOME_PAGE_ITEM_2);
				intent.putExtra(GoodsListActivity.KEY_GOODS_LIST, mUIGoodsList);
				mContext.startActivity(intent);
			}
			else if(v.equals(mIvPic0) || v.equals(mShowTag0) || v.equals(mShowTagSoldOut0)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(0);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
			else if(v.equals(mIvPic1) || v.equals(mShowTag1) || v.equals(mShowTagSoldOut1)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(1);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
			else if(v.equals(mIvPic2) || v.equals(mShowTag2) || v.equals(mShowTagSoldOut2)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(2);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
		}
	}

	// HomePageImageItems
	private class ViewHolderItemImage implements OnClickListener{
		private View mContentView;
		private View mShowTag0;
		private View mShowTag1;
		private View mShowTag2;
		private View mShowTag3;
		private View mShowTag4;
		private View mShowTag5;
		private View mShowTag6;
		private View mShowTag7;
		private View mShowTag8;
		private View mShowTag9;
		private View mShowTag10;
		private View mShowTag11;
		private View mShowTag12;
		private View mShowTag13;
		private View mShowTagSoldOut0;
		private View mShowTagSoldOut1;
		private View mShowTagSoldOut2;
		private View mShowTagSoldOut3;
		private View mShowTagSoldOut4;
		private View mShowTagSoldOut5;
		private View mShowTagSoldOut6;
		private View mShowTagSoldOut7;
		private View mShowTagSoldOut8;
		private View mShowTagSoldOut9;
		private View mShowTagSoldOut10;
		private View mShowTagSoldOut11;
		private View mShowTagSoldOut12;
		private View mShowTagSoldOut13;
		private ImageView mIvPic0;
		private ImageView mIvPic1;
		private ImageView mIvPic2;
		private ImageView mIvPic3;
		private ImageView mIvPic4;
		private ImageView mIvPic5;
		private ImageView mIvPic6;
		private ImageView mIvPic7;
		private ImageView mIvPic8;
		private ImageView mIvPic9;
		private ImageView mIvPic10;
		private ImageView mIvPic11;
		private ImageView mIvPic12;
		private ImageView mIvPic13;
		
		private View mLayoutLine0;
		private View mLayoutLine1;
		private View mLayoutLine2;
		private View mLayoutLine3;
		private View mLayoutLine4;
		private View mLayoutLine5;
		private View mLayoutLine6;
		private View mLayoutLine7;
		
		private List<UIGoodsRecommend> mRecommendList;

		public ViewHolderItemImage(View contentView) {
			mContentView = contentView;
		}

		public void setRecommendList(List<UIGoodsRecommend> list) {
			this.mRecommendList = list;
		}
		
		public View getLayoutLine0() {
			if(mLayoutLine0 == null) {
				mLayoutLine0 = mContentView.findViewById(R.id.portal_item_image_line_0);
			}
			return mLayoutLine0;
		}
		
		public View getLayoutLine1() {
			if(mLayoutLine1 == null) {
				mLayoutLine1 = mContentView.findViewById(R.id.portal_item_image_line_1);
			}
			return mLayoutLine1;
		}
		
		public View getLayoutLine2() {
			if(mLayoutLine2 == null) {
				mLayoutLine2 = mContentView.findViewById(R.id.portal_item_image_line_2);
			}
			return mLayoutLine2;
		}
		
		public View getLayoutLine3() {
			if(mLayoutLine3 == null) {
				mLayoutLine3 = mContentView.findViewById(R.id.portal_item_image_line_3);
			}
			return mLayoutLine3;
		}
		
		public View getLayoutLine4() {
			if(mLayoutLine4 == null) {
				mLayoutLine4 = mContentView.findViewById(R.id.portal_item_image_line_4);
			}
			return mLayoutLine4;
		}
		
		public View getLayoutLine5() {
			if(mLayoutLine5 == null) {
				mLayoutLine5 = mContentView.findViewById(R.id.portal_item_image_line_5);
			}
			return mLayoutLine5;
		}
		
		public View getLayoutLine6() {
			if(mLayoutLine6 == null) {
				mLayoutLine6 = mContentView.findViewById(R.id.portal_item_image_line_6);
			}
			return mLayoutLine6;
		}
		
		public View getLayoutLine7() {
			if(mLayoutLine7 == null) {
				mLayoutLine7 = mContentView.findViewById(R.id.portal_item_image_line_7);
			}
			return mLayoutLine7;
		}

		public View getShowTag0() {
			if (mShowTag0 == null) {
				mShowTag0 = mContentView.findViewById(R.id.portal_item_image_pic_0_show_tag);
				mShowTag0.setOnClickListener(this);
			}
			return mShowTag0;
		}
		
		public View getShowTag1() {
			if (mShowTag1 == null) {
				mShowTag1 = mContentView.findViewById(R.id.portal_item_image_pic_1_show_tag);
				mShowTag1.setOnClickListener(this);
			}
			return mShowTag1;
		}
		
		public View getShowTag2() {
			if (mShowTag2 == null) {
				mShowTag2 = mContentView.findViewById(R.id.portal_item_image_pic_2_show_tag);
				mShowTag2.setOnClickListener(this);
			}
			return mShowTag2;
		}
		
		public View getShowTag3() {
			if (mShowTag3 == null) {
				mShowTag3 = mContentView.findViewById(R.id.portal_item_image_pic_3_show_tag);
				mShowTag3.setOnClickListener(this);
			}
			return mShowTag3;
		}
		
		public View getShowTag4() {
			if (mShowTag4 == null) {
				mShowTag4 = mContentView.findViewById(R.id.portal_item_image_pic_4_show_tag);
				mShowTag4.setOnClickListener(this);
			}
			return mShowTag4;
		}
		
		public View getShowTag5() {
			if (mShowTag5 == null) {
				mShowTag5 = mContentView.findViewById(R.id.portal_item_image_pic_5_show_tag);
				mShowTag5.setOnClickListener(this);
			}
			return mShowTag5;
		}
		
		public View getShowTag6() {
			if (mShowTag6 == null) {
				mShowTag6 = mContentView.findViewById(R.id.portal_item_image_pic_6_show_tag);
				mShowTag6.setOnClickListener(this);
			}
			return mShowTag6;
		}
		
		public View getShowTag7() {
			if (mShowTag7 == null) {
				mShowTag7 = mContentView.findViewById(R.id.portal_item_image_pic_7_show_tag);
				mShowTag7.setOnClickListener(this);
			}
			return mShowTag7;
		}
		
		public View getShowTag8() {
			if (mShowTag8 == null) {
				mShowTag8 = mContentView.findViewById(R.id.portal_item_image_pic_8_show_tag);
				mShowTag8.setOnClickListener(this);
			}
			return mShowTag8;
		}
		
		public View getShowTag9() {
			if (mShowTag9 == null) {
				mShowTag9 = mContentView.findViewById(R.id.portal_item_image_pic_9_show_tag);
				mShowTag9.setOnClickListener(this);
			}
			return mShowTag9;
		}
		
		public View getShowTag10() {
			if (mShowTag10 == null) {
				mShowTag10 = mContentView.findViewById(R.id.portal_item_image_pic_10_show_tag);
				mShowTag10.setOnClickListener(this);
			}
			return mShowTag10;
		}
		
		public View getShowTag11() {
			if (mShowTag11 == null) {
				mShowTag11 = mContentView.findViewById(R.id.portal_item_image_pic_11_show_tag);
				mShowTag11.setOnClickListener(this);
			}
			return mShowTag11;
		}
		
		public View getShowTag12() {
			if (mShowTag12 == null) {
				mShowTag12 = mContentView.findViewById(R.id.portal_item_image_pic_12_show_tag);
				mShowTag12.setOnClickListener(this);
			}
			return mShowTag12;
		}
		
		public View getShowTag13() {
			if (mShowTag13 == null) {
				mShowTag13 = mContentView.findViewById(R.id.portal_item_image_pic_13_show_tag);
				mShowTag13.setOnClickListener(this);
			}
			return mShowTag13;
		}
		
		public View getShowTagSoldOut0() {
			if (mShowTagSoldOut0 == null) {
				mShowTagSoldOut0 = mContentView.findViewById(R.id.portal_item_image_pic_0_show_tag_sold_out);
				mShowTagSoldOut0.setOnClickListener(this);
			}
			return mShowTagSoldOut0;
		}
		
		public View getShowTagSoldOut1() {
			if (mShowTagSoldOut1 == null) {
				mShowTagSoldOut1 = mContentView.findViewById(R.id.portal_item_image_pic_1_show_tag_sold_out);
				mShowTagSoldOut1.setOnClickListener(this);
			}
			return mShowTagSoldOut1;
		}
		
		public View getShowTagSoldOut2() {
			if (mShowTagSoldOut2 == null) {
				mShowTagSoldOut2 = mContentView.findViewById(R.id.portal_item_image_pic_2_show_tag_sold_out);
				mShowTagSoldOut2.setOnClickListener(this);
			}
			return mShowTagSoldOut2;
		}
		
		public View getShowTagSoldOut3() {
			if (mShowTagSoldOut3 == null) {
				mShowTagSoldOut3 = mContentView.findViewById(R.id.portal_item_image_pic_3_show_tag_sold_out);
				mShowTagSoldOut3.setOnClickListener(this);
			}
			return mShowTagSoldOut3;
		}
		
		public View getShowTagSoldOut4() {
			if (mShowTagSoldOut4 == null) {
				mShowTagSoldOut4 = mContentView.findViewById(R.id.portal_item_image_pic_4_show_tag_sold_out);
				mShowTagSoldOut4.setOnClickListener(this);
			}
			return mShowTagSoldOut4;
		}
		
		public View getShowTagSoldOut5() {
			if (mShowTagSoldOut5 == null) {
				mShowTagSoldOut5 = mContentView.findViewById(R.id.portal_item_image_pic_5_show_tag_sold_out);
				mShowTagSoldOut5.setOnClickListener(this);
			}
			return mShowTagSoldOut5;
		}
		
		public View getShowTagSoldOut6() {
			if (mShowTagSoldOut6 == null) {
				mShowTagSoldOut6 = mContentView.findViewById(R.id.portal_item_image_pic_6_show_tag_sold_out);
				mShowTagSoldOut6.setOnClickListener(this);
			}
			return mShowTagSoldOut6;
		}
		
		public View getShowTagSoldOut7() {
			if (mShowTagSoldOut7 == null) {
				mShowTagSoldOut7 = mContentView.findViewById(R.id.portal_item_image_pic_7_show_tag_sold_out);
				mShowTagSoldOut7.setOnClickListener(this);
			}
			return mShowTagSoldOut7;
		}
		
		public View getShowTagSoldOut8() {
			if (mShowTagSoldOut8 == null) {
				mShowTagSoldOut8 = mContentView.findViewById(R.id.portal_item_image_pic_8_show_tag_sold_out);
				mShowTagSoldOut8.setOnClickListener(this);
			}
			return mShowTagSoldOut8;
		}
		
		public View getShowTagSoldOut9() {
			if (mShowTagSoldOut9 == null) {
				mShowTagSoldOut9 = mContentView.findViewById(R.id.portal_item_image_pic_9_show_tag_sold_out);
				mShowTagSoldOut9.setOnClickListener(this);
			}
			return mShowTagSoldOut9;
		}
		
		public View getShowTagSoldOut10() {
			if (mShowTagSoldOut10 == null) {
				mShowTagSoldOut10 = mContentView.findViewById(R.id.portal_item_image_pic_10_show_tag_sold_out);
				mShowTagSoldOut10.setOnClickListener(this);
			}
			return mShowTagSoldOut10;
		}
		
		public View getShowTagSoldOut11() {
			if (mShowTagSoldOut11 == null) {
				mShowTagSoldOut11 = mContentView.findViewById(R.id.portal_item_image_pic_11_show_tag_sold_out);
				mShowTagSoldOut11.setOnClickListener(this);
			}
			return mShowTagSoldOut11;
		}
		
		public View getShowTagSoldOut12() {
			if (mShowTagSoldOut12 == null) {
				mShowTagSoldOut12 = mContentView.findViewById(R.id.portal_item_image_pic_12_show_tag_sold_out);
				mShowTagSoldOut12.setOnClickListener(this);
			}
			return mShowTagSoldOut12;
		}
		
		public View getShowTagSoldOut13() {
			if (mShowTagSoldOut13 == null) {
				mShowTagSoldOut13 = mContentView.findViewById(R.id.portal_item_image_pic_13_show_tag_sold_out);
				mShowTagSoldOut13.setOnClickListener(this);
			}
			return mShowTagSoldOut13;
		}
		
		public ImageView getIvPic0() {
			if (mIvPic0 == null) {
				mIvPic0 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_0);
				mIvPic0.setOnClickListener(this);
			}
			return mIvPic0;
		}

		public ImageView getIvPic1() {
			if (mIvPic1 == null) {
				mIvPic1 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_1);
				mIvPic1.setOnClickListener(this);
			}
			return mIvPic1;
		}

		public ImageView getIvPic2() {
			if (mIvPic2 == null) {
				mIvPic2 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_2);
				mIvPic2.setOnClickListener(this);
			}
			return mIvPic2;
		}

		public ImageView getIvPic3() {
			if (mIvPic3 == null) {
				mIvPic3 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_3);
				mIvPic3.setOnClickListener(this);
			}
			return mIvPic3;
		}

		public ImageView getIvPic4() {
			if (mIvPic4 == null) {
				mIvPic4 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_4);
				mIvPic4.setOnClickListener(this);
			}
			return mIvPic4;
		}

		public ImageView getIvPic5() {
			if (mIvPic5 == null) {
				mIvPic5 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_5);
				mIvPic5.setOnClickListener(this);
			}
			return mIvPic5;
		}

		public ImageView getIvPic6() {
			if (mIvPic6 == null) {
				mIvPic6 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_6);
				mIvPic6.setOnClickListener(this);
			}
			return mIvPic6;
		}

		public ImageView getIvPic7() {
			if (mIvPic7 == null) {
				mIvPic7 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_7);
				mIvPic7.setOnClickListener(this);
			}
			return mIvPic7;
		}

		public ImageView getIvPic8() {
			if (mIvPic8 == null) {
				mIvPic8 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_8);
				mIvPic8.setOnClickListener(this);
			}
			return mIvPic8;
		}

		public ImageView getIvPic9() {
			if (mIvPic9 == null) {
				mIvPic9 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_9);
				mIvPic9.setOnClickListener(this);
			}
			return mIvPic9;
		}

		public ImageView getIvPic10() {
			if (mIvPic10 == null) {
				mIvPic10 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_10);
				mIvPic10.setOnClickListener(this);
			}
			return mIvPic10;
		}

		public ImageView getIvPic11() {
			if (mIvPic11 == null) {
				mIvPic11 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_11);
				mIvPic11.setOnClickListener(this);
			}
			return mIvPic11;
		}

		public ImageView getIvPic12() {
			if (mIvPic12 == null) {
				mIvPic12 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_12);
				mIvPic12.setOnClickListener(this);
			}
			return mIvPic12;
		}

		public ImageView getIvPic13() {
			if (mIvPic13 == null) {
				mIvPic13 = (ImageView) mContentView
						.findViewById(R.id.portal_item_image_pic_13);
				mIvPic13.setOnClickListener(this);
			}
			return mIvPic13;
		}

		@Override
		public void onClick(View v) {
			UIGoodsRecommend ugr = null;
			int showIndex = -1;
			if(v.equals(mIvPic0) || v.equals(mShowTag0) || v.equals(mShowTagSoldOut0)){
				showIndex = 1;
			}
			else if(v.equals(mIvPic1) || v.equals(mShowTag1) || v.equals(mShowTagSoldOut1)){
				showIndex = 2;
			}
			else if(v.equals(mIvPic2) || v.equals(mShowTag2) || v.equals(mShowTagSoldOut2)){
				showIndex = 3;
			}
			else if(v.equals(mIvPic3) || v.equals(mShowTag3) || v.equals(mShowTagSoldOut3)){
				showIndex = 4;
			}
			else if(v.equals(mIvPic4) || v.equals(mShowTag4) || v.equals(mShowTagSoldOut4)){
				showIndex = 5;
			}
			else if(v.equals(mIvPic5) || v.equals(mShowTag5) || v.equals(mShowTagSoldOut5)){
				showIndex = 6;
			}
			else if(v.equals(mIvPic6) || v.equals(mShowTag6) || v.equals(mShowTagSoldOut6)){
				showIndex = 7;
			}
			else if(v.equals(mIvPic7) || v.equals(mShowTag7) || v.equals(mShowTagSoldOut7)){
				showIndex = 8;
			}
			else if(v.equals(mIvPic8) || v.equals(mShowTag8) || v.equals(mShowTagSoldOut8)){
				showIndex = 9;
			}
			else if(v.equals(mIvPic9) || v.equals(mShowTag9) || v.equals(mShowTagSoldOut9)){
				showIndex = 10;
			}
			else if(v.equals(mIvPic10) || v.equals(mShowTag10) || v.equals(mShowTagSoldOut10)){
				showIndex = 11;
			}
			else if(v.equals(mIvPic11) || v.equals(mShowTag11) || v.equals(mShowTagSoldOut11)){
				showIndex = 12;
			}
			else if(v.equals(mIvPic12) || v.equals(mShowTag12) || v.equals(mShowTagSoldOut12)){
				showIndex = 13;
			}
			else if(v.equals(mIvPic13) || v.equals(mShowTag13) || v.equals(mShowTagSoldOut13)){
				showIndex = 14;
			}
			
			for(UIGoodsRecommend recommend : mRecommendList) {
				if(recommend.getShowIndex() == showIndex) {
					ugr = recommend;
					break;
				}
			}
			
			if(ugr != null) {
				String showStyle = ugr.getShowStyle();
				if(UIGoodsRecommend.SHOW_GOODS.equals(showStyle)) {
					 Intent intent = new Intent(mContext, DetailActivity.class);
					 intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, ugr.getGoodsObjectId());
					 mContext.startActivity(intent); 
				}
				else if(UIGoodsRecommend.SHOW_GOODSSTYLE.equals(showStyle)) {
					Intent intent = new Intent(mContext, GoodsListActivity.class);
					intent.putExtra(GoodsListActivity.KEY_LIST_TYPE, GoodsListActivity.LIST_TYPE_FOR_HOME_PAGE_IMAGE_ITEM);
					intent.putExtra(GoodsListActivity.KEY_GOODS_RECOMMEND_OBJECT_ID, ugr.getObjectId());
					mContext.startActivity(intent);
				}
				else if(UIGoodsRecommend.SHOW_STORE.equals(showStyle)) {
					Intent intent = new Intent(mContext, ActivityIndependentStoreHome.class);
					intent.putExtra("myStore", String.valueOf(ugr.getStoreId()));
					mContext.startActivity(intent);
				}
			}
		}
	}

	// HomePageItems(itme3) with title
	private class ViewHolderItem3WithTitle implements OnClickListener{
		private View mContentView;
		private ImageView mTitleIcon;
		private View mShowTag0;
		private View mShowTag1;
		private View mShowTag2;
		private View mShowTagSoldOut0;
		private View mShowTagSoldOut1;
		private View mShowTagSoldOut2;
		private ImageView mIvPic0;
		private ImageView mIvPic1;
		private ImageView mIvPic2;
		private TextView mTvTitleDes;
		private TextView mTvDes0;
		private TextView mTvDes1;
		private TextView mTvDes2;
		private TextView mTvPrice0;
		private TextView mTvPrice1;
		private TextView mTvPrice2;
		private TextView mTvUnit0;
		private TextView mTvUnit1;
		private TextView mTvUnit2;
		private TextView mTvPeopleCount0;
		private TextView mTvPeopleCount1;
		private TextView mTvPeopleCount2;
		private View mViewLayoutItem0;
		private View mViewLayoutItem1;
		private View mViewLayoutItem2;
		
		private ArrayList<UIGoods> mUIGoodsList = new ArrayList<UIGoods>();

		public ViewHolderItem3WithTitle(View contentView) {
			mContentView = contentView;
		}
		
		public void setUIGoodsList(List<UIGoods> list) {
			mUIGoodsList.clear();
			if(list != null) {
				this.mUIGoodsList.addAll(list);
			}
		}

		public ImageView getTitleIcon() {
			if (mTitleIcon == null) {
				mTitleIcon = (ImageView)mContentView
						.findViewById(R.id.portal_item_3_with_title_icon);
			}
			return mTitleIcon;
		}
		
		public TextView getTvTitleDes() {
			if (mTvTitleDes == null) {
				mTvTitleDes = (TextView)mContentView
						.findViewById(R.id.portal_item_3_with_title_des);
			}
			return mTvTitleDes;
		}
		
		public View getViewLayoutItem0() {
			if(mViewLayoutItem0 == null) {
				mViewLayoutItem0 = mContentView.findViewById(R.id.portal_item_3_with_title_0_layout);
			}
			return mViewLayoutItem0;
		}

		public View getViewLayoutItem1() {
			if(mViewLayoutItem1 == null) {
				mViewLayoutItem1 = mContentView.findViewById(R.id.portal_item_3_with_title_1_layout);
			}
			return mViewLayoutItem1;
		}

		public View getViewLayoutItem2() {
			if(mViewLayoutItem2 == null) {
				mViewLayoutItem2 = mContentView.findViewById(R.id.portal_item_3_with_title_2_layout);
			}
			return mViewLayoutItem2;
		}
		
		public View getShowTag0() {
			if (mShowTag0 == null) {
				mShowTag0 = mContentView.findViewById(R.id.portal_item_3_with_title_0_pic_show_tag);
				mShowTag0.setOnClickListener(this);
			}
			return mShowTag0;
		}
		
		public View getShowTag1() {
			if (mShowTag1 == null) {
				mShowTag1 = mContentView.findViewById(R.id.portal_item_3_with_title_1_pic_show_tag);
				mShowTag1.setOnClickListener(this);
			}
			return mShowTag1;
		}
		
		public View getShowTag2() {
			if (mShowTag2 == null) {
				mShowTag2 = mContentView.findViewById(R.id.portal_item_3_with_title_2_pic_show_tag);
				mShowTag2.setOnClickListener(this);
			}
			return mShowTag2;
		}
		
		public View getShowTagSoldOut0() {
			if (mShowTagSoldOut0 == null) {
				mShowTagSoldOut0 = mContentView.findViewById(R.id.portal_item_3_with_title_0_pic_show_tag_sold_out);
				mShowTagSoldOut0.setOnClickListener(this);
			}
			return mShowTagSoldOut0;
		}
		
		public View getShowTagSoldOut1() {
			if (mShowTagSoldOut1 == null) {
				mShowTagSoldOut1 = mContentView.findViewById(R.id.portal_item_3_with_title_1_pic_show_tag_sold_out);
				mShowTagSoldOut1.setOnClickListener(this);
			}
			return mShowTagSoldOut1;
		}
		
		public View getShowTagSoldOut2() {
			if (mShowTagSoldOut2 == null) {
				mShowTagSoldOut2 = mContentView.findViewById(R.id.portal_item_3_with_title_2_pic_show_tag_sold_out);
				mShowTagSoldOut2.setOnClickListener(this);
			}
			return mShowTagSoldOut2;
		}

		public ImageView getIvPic0() {
			if (mIvPic0 == null) {
				mIvPic0 = (ImageView) mContentView
						.findViewById(R.id.portal_item_3_with_title_0_pic);
				mIvPic0.setOnClickListener(this);
			}
			return mIvPic0;
		}

		public ImageView getIvPic1() {
			if (mIvPic1 == null) {
				mIvPic1 = (ImageView) mContentView
						.findViewById(R.id.portal_item_3_with_title_1_pic);
				mIvPic1.setOnClickListener(this);
			}
			return mIvPic1;
		}

		public ImageView getIvPic2() {
			if (mIvPic2 == null) {
				mIvPic2 = (ImageView) mContentView
						.findViewById(R.id.portal_item_3_with_title_2_pic);
				mIvPic2.setOnClickListener(this);
			}
			return mIvPic2;
		}

		public TextView getTvDes0() {
			if (mTvDes0 == null) {
				mTvDes0 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_0_des);
			}
			return mTvDes0;
		}

		public TextView getTvDes1() {
			if (mTvDes1 == null) {
				mTvDes1 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_1_des);
			}
			return mTvDes1;
		}

		public TextView getTvDes2() {
			if (mTvDes2 == null) {
				mTvDes2 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_2_des);
			}
			return mTvDes2;
		}
		
		public TextView getTvPrice0() {
			if (mTvPrice0 == null) {
				mTvPrice0 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_0_price);
			}
			return mTvPrice0;
		}
		
		public TextView getTvPrice1() {
			if (mTvPrice1 == null) {
				mTvPrice1 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_1_price);
			}
			return mTvPrice1;
		}
		
		public TextView getTvPrice2() {
			if (mTvPrice2 == null) {
				mTvPrice2 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_2_price);
			}
			return mTvPrice2;
		}
		
		public TextView getTvUnit0() {
			if (mTvUnit0 == null) {
				mTvUnit0 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_0_price_unit);
			}
			return mTvUnit0;
		}
		
		public TextView getTvUnit1() {
			if (mTvUnit1 == null) {
				mTvUnit1 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_1_price_unit);
			}
			return mTvUnit1;
		}
		
		public TextView getTvUnit2() {
			if (mTvUnit2 == null) {
				mTvUnit2 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_2_price_unit);
			}
			return mTvUnit2;
		}
		
		public TextView getTvPeopleCount0() {
			if (mTvPeopleCount0 == null) {
				mTvPeopleCount0 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_0_people_count);
			}
			return mTvPeopleCount0;
		}
		
		public TextView getTvPeopleCount1() {
			if (mTvPeopleCount1 == null) {
				mTvPeopleCount1 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_1_people_count);
			}
			return mTvPeopleCount1;
		}
		
		public TextView getTvPeopleCount2() {
			if (mTvPeopleCount2 == null) {
				mTvPeopleCount2 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_with_title_2_people_count);
			}
			return mTvPeopleCount2;
		}

		@Override
		public void onClick(View v) {
			if(v.equals(mIvPic0) || v.equals(mShowTag0) || v.equals(mShowTagSoldOut0)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(0);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
			else if(v.equals(mIvPic1) || v.equals(mShowTag1) || v.equals(mShowTagSoldOut1)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(1);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
			else if(v.equals(mIvPic2) || v.equals(mShowTag2) || v.equals(mShowTagSoldOut2)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(2);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
		}
	}

	// HomePageItems(itme3)
	private class ViewHolderItem3 implements OnClickListener{
		private View mContentView;
		private View mShowTag0;
		private View mShowTag1;
		private View mShowTag2;
		private View mShowTagSoldOut0;
		private View mShowTagSoldOut1;
		private View mShowTagSoldOut2;
		private ImageView mIvPic0;
		private ImageView mIvPic1;
		private ImageView mIvPic2;
		private TextView mTvDes0;
		private TextView mTvDes1;
		private TextView mTvDes2;
		private TextView mTvPrice0;
		private TextView mTvPrice1;
		private TextView mTvPrice2;
		private TextView mTvUnit0;
		private TextView mTvUnit1;
		private TextView mTvUnit2;
		private TextView mTvPeopleCount0;
		private TextView mTvPeopleCount1;
		private TextView mTvPeopleCount2;
		private View mViewLayoutItem0;
		private View mViewLayoutItem1;
		private View mViewLayoutItem2;
		
		private ArrayList<UIGoods> mUIGoodsList = new ArrayList<UIGoods>();

		public ViewHolderItem3(View contentView) {
			mContentView = contentView;
		}
		
		public void setUIGoodsList(List<UIGoods> list) {
			mUIGoodsList.clear();
			if(list != null) {
				this.mUIGoodsList.addAll(list);
			}
		}
		
		public View getViewLayoutItem0() {
			if(mViewLayoutItem0 == null) {
				mViewLayoutItem0 = mContentView.findViewById(R.id.portal_item_3_0_layout);
			}
			return mViewLayoutItem0;
		}

		public View getViewLayoutItem1() {
			if(mViewLayoutItem1 == null) {
				mViewLayoutItem1 = mContentView.findViewById(R.id.portal_item_3_1_layout);
			}
			return mViewLayoutItem1;
		}

		public View getViewLayoutItem2() {
			if(mViewLayoutItem2 == null) {
				mViewLayoutItem2 = mContentView.findViewById(R.id.portal_item_3_2_layout);
			}
			return mViewLayoutItem2;
		}

		public View getShowTag0() {
			if (mShowTag0 == null) {
				mShowTag0 = mContentView.findViewById(R.id.portal_item_3_0_pic_show_tag);
				mShowTag0.setOnClickListener(this);
			}
			return mShowTag0;
		}
		
		public View getShowTag1() {
			if (mShowTag1 == null) {
				mShowTag1 = mContentView.findViewById(R.id.portal_item_3_1_pic_show_tag);
				mShowTag1.setOnClickListener(this);
			}
			return mShowTag1;
		}
		
		public View getShowTag2() {
			if (mShowTag2 == null) {
				mShowTag2 = mContentView.findViewById(R.id.portal_item_3_2_pic_show_tag);
				mShowTag2.setOnClickListener(this);
			}
			return mShowTag2;
		}
		
		public View getShowTagSoldOut0() {
			if (mShowTagSoldOut0 == null) {
				mShowTagSoldOut0 = mContentView.findViewById(R.id.portal_item_3_0_pic_show_tag_sold_out);
				mShowTagSoldOut0.setOnClickListener(this);
			}
			return mShowTagSoldOut0;
		}
		
		public View getShowTagSoldOut1() {
			if (mShowTagSoldOut1 == null) {
				mShowTagSoldOut1 = mContentView.findViewById(R.id.portal_item_3_1_pic_show_tag_sold_out);
				mShowTagSoldOut1.setOnClickListener(this);
			}
			return mShowTagSoldOut1;
		}
		
		public View getShowTagSoldOut2() {
			if (mShowTagSoldOut2 == null) {
				mShowTagSoldOut2 = mContentView.findViewById(R.id.portal_item_3_2_pic_show_tag_sold_out);
				mShowTagSoldOut2.setOnClickListener(this);
			}
			return mShowTagSoldOut2;
		}
		
		public ImageView getIvPic0() {
			if (mIvPic0 == null) {
				mIvPic0 = (ImageView) mContentView
						.findViewById(R.id.portal_item_3_0_pic);
				mIvPic0.setOnClickListener(this);
			}
			return mIvPic0;
		}

		public ImageView getIvPic1() {
			if (mIvPic1 == null) {
				mIvPic1 = (ImageView) mContentView
						.findViewById(R.id.portal_item_3_1_pic);
				mIvPic1.setOnClickListener(this);
			}
			return mIvPic1;
		}

		public ImageView getIvPic2() {
			if (mIvPic2 == null) {
				mIvPic2 = (ImageView) mContentView
						.findViewById(R.id.portal_item_3_2_pic);
				mIvPic2.setOnClickListener(this);
			}
			return mIvPic2;
		}

		public TextView getTvDes0() {
			if (mTvDes0 == null) {
				mTvDes0 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_0_des);
			}
			return mTvDes0;
		}

		public TextView getTvDes1() {
			if (mTvDes1 == null) {
				mTvDes1 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_1_des);
			}
			return mTvDes1;
		}

		public TextView getTvDes2() {
			if (mTvDes2 == null) {
				mTvDes2 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_2_des);
			}
			return mTvDes2;
		}
		
		public TextView getTvPrice0() {
			if (mTvPrice0 == null) {
				mTvPrice0 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_0_price);
			}
			return mTvPrice0;
		}
		
		public TextView getTvPrice1() {
			if (mTvPrice1 == null) {
				mTvPrice1 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_1_price);
			}
			return mTvPrice1;
		}
		
		public TextView getTvPrice2() {
			if (mTvPrice2 == null) {
				mTvPrice2 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_2_price);
			}
			return mTvPrice2;
		}
		
		public TextView getTvUnit0() {
			if (mTvUnit0 == null) {
				mTvUnit0 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_0_price_unit);
			}
			return mTvUnit0;
		}
		
		public TextView getTvUnit1() {
			if (mTvUnit1 == null) {
				mTvUnit1 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_1_price_unit);
			}
			return mTvUnit1;
		}
		
		public TextView getTvUnit2() {
			if (mTvUnit2 == null) {
				mTvUnit2 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_2_price_unit);
			}
			return mTvUnit2;
		}
		
		public TextView getTvPeopleCount0() {
			if (mTvPeopleCount0 == null) {
				mTvPeopleCount0 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_0_people_count);
			}
			return mTvPeopleCount0;
		}
		
		public TextView getTvPeopleCount1() {
			if (mTvPeopleCount1 == null) {
				mTvPeopleCount1 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_1_people_count);
			}
			return mTvPeopleCount1;
		}
		
		public TextView getTvPeopleCount2() {
			if (mTvPeopleCount2 == null) {
				mTvPeopleCount2 = (TextView) mContentView
						.findViewById(R.id.portal_item_3_2_people_count);
			}
			return mTvPeopleCount2;
		}

		@Override
		public void onClick(View v) {
			if(v.equals(mIvPic0) || v.equals(mShowTag0) || v.equals(mShowTagSoldOut0)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(0);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
			else if(v.equals(mIvPic1) || v.equals(mShowTag1) || v.equals(mShowTagSoldOut1)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(1);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
			else if(v.equals(mIvPic2) || v.equals(mShowTag2) || v.equals(mShowTagSoldOut2)) {
				try{
					UIGoods uiGoods = mUIGoodsList.get(2);
					Intent intent = new Intent(mContext, DetailActivity.class);
					intent.putExtra(DetailActivity.KEY_DETAIL_OBJECTID, uiGoods.getObjectId());
					mContext.startActivity(intent); 
				}
				catch(Exception e) {
					e.printStackTrace();
				}
			}
		}
	}
}